diff --git a/src/main/kotlin/no/nav/pensjon/opptjening/omsorgsopptjening/start/innlesning/barnetrygd/BarnetrygdTokenProvider.kt b/src/main/kotlin/no/nav/pensjon/opptjening/omsorgsopptjening/start/innlesning/barnetrygd/BarnetrygdTokenProvider.kt index 2309b22..e1ff0e9 100644 --- a/src/main/kotlin/no/nav/pensjon/opptjening/omsorgsopptjening/start/innlesning/barnetrygd/BarnetrygdTokenProvider.kt +++ b/src/main/kotlin/no/nav/pensjon/opptjening/omsorgsopptjening/start/innlesning/barnetrygd/BarnetrygdTokenProvider.kt @@ -13,12 +13,16 @@ import pensjon.opptjening.azure.ad.client.TokenProvider @Profile("dev-gcp", "prod-gcp") class BarnetrygdTokenProvider( @Value("\${BARNETRYGD_API_ID}") val appId: String, - private val azureAdConfig: AzureAdTokenClientConfig, + azureAdConfig: AzureAdTokenClientConfig +) : TokenProvider { private val config: AzureAdConfig = AzureAdVariableConfig( azureAppClientId = azureAdConfig.azureAppClientId, azureAppClientSecret = azureAdConfig.azureAppClientSecret, targetApiId = appId, wellKnownUrl = azureAdConfig.wellKnownUrl, - ), + ) private val tokenProvider: TokenProvider = AzureAdTokenProvider(config) -) : TokenProvider by tokenProvider \ No newline at end of file + override fun getToken(): String { + return tokenProvider.getToken() + } +} \ No newline at end of file