Repository navigation
Core: Assume issued_token_type is access_token to fully comply with RFC 6749 #10314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -254,7 +254,6 @@ private static OAuthTokenResponse handleOAuthRequest(Object body) { | |
| case "client_credentials": | ||
| return OAuthTokenResponse.builder() | ||
| .withToken("client-credentials-token:sub=" + request.get("client_id")) | ||
| .withIssuedTokenType("urn:ietf:params:oauth:token-type:access_token") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would probably leave this as-is, since
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't agree: this flow is not governed by RFC 8693, this is RFC 6749 section 4.4. |
||
| .withTokenType("Bearer") | ||
| .build(); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adutra do you maybe know if Keycloak fully supports RFC 8693? The token exchange follows https://www.rfc-editor.org/rfc/rfc8693#name-successful-response, where
issued_token_typeisrequiredUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found keycloak/keycloak#26502, which states unfortunately that Keycloak deviates from the standard.
I can see that we might add the null check as a workaround for such cases where the auth server doesn't send back an
issued_token_typebut I'd like to first see what other people in the community think about this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, Keycloak does not fully implement it. Quoting from their Securing Applications and Services Guide:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the problem here is wider:
issued_token_typeis only defined for the token exchange flow (RFC 8693). This field does not exist for standard flows from RFC 6749. So the following scenario can happen even with fully-compliant servers:client_credentialsto authenticate initially;issued_token_type, which is normal since it's not defined for this flow.subjectTokenTypeis null.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nastra also see this comment which gives some context on why we have the problem today: #4771 (comment)