Skip to content
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

Get all code flow credentials visible to SecurityIdentityAugmentors #19548

Merged

Conversation

sberyozkin
Copy link
Member

A problem to do with AccessTokenCredential not visible to custom SecurityIdentityAugmentors for OIDC web-app applications was reported on Zulip (note they are all visible to the endpoint code).

In the code flow, the primary IdTokenCredential only used to be set by QuarkusIdentityProvider with CodeAuthenticationMechanism adding AccessTokenCredential and also RefreshToken - but it is done as a follow up after IdentityProviderManager has completed the SecurityIdentity construction with SecurityIdentityAugmentors already being checked.

So this PR simply adds all the credentials at the same time, IdTokenCredential plus AccessTokenCredential and also RefreshToken as part of the IdentityProvider flow (thus making them all visible to the augmentors as well) and removes the unnecessary code to do with the identity augmentation from CodeAuthenticationMechanism - saves on the identity copy, as apart from adding AccessTokenCredential/RefreshToken a bit late it also adds a permission checker - because it could not copy them from the existing one - which is not needed now.

@stuartwdouglas I'll rebase it once your PR goes in :-)

@sberyozkin sberyozkin force-pushed the access_token_cred_in_augmentors branch from d9817c2 to 9541ae2 Compare August 23, 2021 08:38
@sberyozkin sberyozkin merged commit 504e824 into quarkusio:main Aug 23, 2021
@quarkus-bot quarkus-bot bot added this to the 2.3 - main milestone Aug 23, 2021
@sberyozkin sberyozkin deleted the access_token_cred_in_augmentors branch August 23, 2021 10:02
@gsmet gsmet modified the milestones: 2.3 - main, 2.2.0.Final Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants