Skip to content

Commit

Permalink
Rettar sikkerheitsissue (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsop-nav authored Jan 4, 2024
1 parent 7ce2384 commit 02c3df1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/etterlatte-proxy/src/main/kotlin/auth/Authentication.kt
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

0 comments on commit 02c3df1

Please sign in to comment.