Add configuration to skip copying assertion audience in JWT bearer grant type#4076
Open
elatt wants to merge 7 commits intoory:masterfrom
Open
Add configuration to skip copying assertion audience in JWT bearer grant type#4076elatt wants to merge 7 commits intoory:masterfrom
elatt wants to merge 7 commits intoory:masterfrom
Conversation
elatt
commented
Apr 9, 2026
fosite/config_default.go
Outdated
Comment on lines
+164
to
+166
| // GrantTypeJWTBearerCopyAssertionAudience indicates whether the audience from the assertion JWT should be | ||
| // copied into the resulting access token. Defaults to true for backwards compatibility. | ||
| GrantTypeJWTBearerCopyAssertionAudience *bool |
Contributor
Author
There was a problem hiding this comment.
I don't like how we need to have this be a pointer just to handle the default unset behavior. I'm thinking of just flipping the name of this param. However, I also wouldn't like inverting the logic of the flag because then you are dealing with a double negative 🤔
Contributor
Author
There was a problem hiding this comment.
Suggested change
| // GrantTypeJWTBearerCopyAssertionAudience indicates whether the audience from the assertion JWT should be | |
| // copied into the resulting access token. Defaults to true for backwards compatibility. | |
| GrantTypeJWTBearerCopyAssertionAudience *bool | |
| // GrantTypeJWTBearerOmitAssertionAudience indicates whether the audience from the assertion JWT should be | |
| // copied into the resulting access token. Defaults to false for backwards compatibility. | |
| GrantTypeJWTBearerOmitAssertionAudience bool |
…ving pointer Agent-Logs-Url: https://github.com/datarobot-forks/hydra/sessions/b002d7b7-a0e5-4e55-b97d-4ab7d3450d04 Co-authored-by: elatt <2617872+elatt@users.noreply.github.com>
…plain bool GrantTypeJWTBearerOmitAssertionAudience Agent-Logs-Url: https://github.com/datarobot-forks/hydra/sessions/b002d7b7-a0e5-4e55-b97d-4ab7d3450d04 Co-authored-by: elatt <2617872+elatt@users.noreply.github.com>
7 tasks
Agent-Logs-Url: https://github.com/datarobot-forks/hydra/sessions/2f217798-4d49-45a8-b852-44b3bf5e678c Co-authored-by: elatt <2617872+elatt@users.noreply.github.com>
…g-logic refactor: replace *bool GrantTypeJWTBearerCopyAssertionAudience with plain bool GrantTypeJWTBearerOmitAssertionAudience
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a configuration option to control whether the audience from the assertion JWT is copied into the resulting access token in the JWT bearer grant type. By default, this behavior remains enabled. The implementation includes updates to the configuration interface, handler logic, and tests to ensure expected functionality.