Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rettar sikkerheitsissue #168

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import io.ktor.server.auth.Authentication
import io.ktor.server.auth.jwt.JWTPrincipal
import io.ktor.server.auth.jwt.jwt
import no.nav.etterlatte.config.Config
import java.net.URL
import java.net.URI
import java.util.concurrent.TimeUnit

fun Application.installAuthentication(configAad: Config.AAD) {
val jwkProviderAad = JwkProviderBuilder(URL(configAad.metadata.jwksUri))
val jwkProviderAad = JwkProviderBuilder(URI(configAad.metadata.jwksUri).toURL())
// cache up to 10 JWKs for 24 hours
.cached(10, 24, TimeUnit.HOURS)
// if not cached, only allow max 10 different keys per minute to be fetched from external provider
Expand Down