diff --git a/src/main/kotlin/no/nav/security/mock/oauth2/token/OAuth2TokenCallback.kt b/src/main/kotlin/no/nav/security/mock/oauth2/token/OAuth2TokenCallback.kt index a66c10f9..110403ed 100644 --- a/src/main/kotlin/no/nav/security/mock/oauth2/token/OAuth2TokenCallback.kt +++ b/src/main/kotlin/no/nav/security/mock/oauth2/token/OAuth2TokenCallback.kt @@ -62,7 +62,9 @@ open class DefaultOAuth2TokenCallback "tid" to issuerId, ).apply { putAll(claims) - put("azp", tokenRequest.clientIdAsString()) + if (tokenRequest.grantType() == GrantType.AUTHORIZATION_CODE) { + put("azp", tokenRequest.clientIdAsString()) + } } override fun tokenExpiry(): Long = expiry