diff --git a/src/main/kotlin/no/nav/k9/los/AccessTokenClientResolver.kt b/src/main/kotlin/no/nav/k9/los/AccessTokenClientResolver.kt index 3f8771f23..83e00b6e0 100644 --- a/src/main/kotlin/no/nav/k9/los/AccessTokenClientResolver.kt +++ b/src/main/kotlin/no/nav/k9/los/AccessTokenClientResolver.kt @@ -1,24 +1,15 @@ package no.nav.k9.los import no.nav.helse.dusseldorf.ktor.auth.Client -import no.nav.helse.dusseldorf.ktor.auth.ClientSecretClient import no.nav.helse.dusseldorf.ktor.auth.PrivateKeyClient import no.nav.helse.dusseldorf.oauth2.client.DirectKeyId import no.nav.helse.dusseldorf.oauth2.client.FromJwk import no.nav.helse.dusseldorf.oauth2.client.SignedJwtAccessTokenClient import no.nav.k9.los.Configuration.Companion.AZURE_V2_ALIAS -import no.nav.k9.los.Configuration.Companion.NAIS_STS_ALIAS class AccessTokenClientResolver( private val clients: Map) { - private val naisSts = naisStsClient().let { - NaisStsAccessTokenClient( - clientId = it.clientId(), - clientSecret = it.clientSecret, - tokenEndpoint = it.tokenEndpoint() - ) - } private val azureV2 = azureV2Client().let { SignedJwtAccessTokenClient( clientId = it.clientId(), @@ -28,13 +19,6 @@ class AccessTokenClientResolver( ) } - private fun naisStsClient() : ClientSecretClient { - val client = clients.getOrElse(NAIS_STS_ALIAS) { - throw IllegalStateException("Client[$NAIS_STS_ALIAS] må være satt opp.") - } - return client as ClientSecretClient - } - private fun azureV2Client() : PrivateKeyClient { val client = clients.getOrElse(AZURE_V2_ALIAS) { throw IllegalStateException("Client[$AZURE_V2_ALIAS] må være satt opp.") @@ -42,6 +26,5 @@ class AccessTokenClientResolver( return client as PrivateKeyClient } - internal fun naisSts() = naisSts internal fun azureV2() = azureV2 } \ No newline at end of file diff --git a/src/main/kotlin/no/nav/k9/los/Configuration.kt b/src/main/kotlin/no/nav/k9/los/Configuration.kt index 064020f15..b3e6ce65f 100644 --- a/src/main/kotlin/no/nav/k9/los/Configuration.kt +++ b/src/main/kotlin/no/nav/k9/los/Configuration.kt @@ -16,7 +16,6 @@ import java.time.temporal.ChronoUnit data class Configuration(private val config: ApplicationConfig) { companion object { - internal const val NAIS_STS_ALIAS = "nais-sts" internal const val AZURE_V2_ALIAS = "azure-v2" }