Skip to content

Commit 5aa7bdb

Browse files
tommytroentronghnkimtore
committed
fix: add azp claim in auth_code flow only
* fixes #752 Co-authored-by: tronghn <[email protected]> Co-authored-by: kimtore <[email protected]>
1 parent 933ea62 commit 5aa7bdb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/no/nav/security/mock/oauth2/token/OAuth2TokenCallback.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ open class DefaultOAuth2TokenCallback
6262
"tid" to issuerId,
6363
).apply {
6464
putAll(claims)
65-
put("azp", tokenRequest.clientIdAsString())
65+
if (tokenRequest.grantType() == GrantType.AUTHORIZATION_CODE) {
66+
put("azp", tokenRequest.clientIdAsString())
67+
}
6668
}
6769

6870
override fun tokenExpiry(): Long = expiry

0 commit comments

Comments
 (0)