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

OIDC client support for using JWTs as Authorization Grants #41213

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented Jun 14, 2024

Fixes #40905.

This PR builds on the work started by @argenstijn and makes it possible to send OIDC client JWT authentication token as a JWT bearer grant assertion to support a Salesforce integration.

OIDC client must always authenticate to the OIDC server in order to complete a token grant exchange. There could be many types of grants, and many types of the OIDC client authentication. For example, OIDC client can start a client credentials grant token exchange and provide a client id and secret to authenticate. In fact, a client credentials grant can be supported instead by a client JWT authentication options.

In the Salesforce case, the client JWT authentication token plays the role of the JWT bearer grant assertion value. Essentially it is like a client credentials grant, but instead of setting the grant_type to client_credentials and supplying the JWT authentication token as client assertion authentication parameters, Salesforce expects a JWT bearer grant type whose value is the same authentication token expressed as an assertion property.

The PR is very simple, it adds an assertion boolean property to the JWT authentication group (instead of originally suggested grant) and if it is set, OIDC client passes it as an assertion form property if the correct JWT bearer grant is configured by the user. Test is added to confirm it works as expected

@sberyozkin sberyozkin force-pushed the oidc_client_jwt_bearer_grant branch from 4c3135f to e6e18b4 Compare June 14, 2024 16:19
@sberyozkin
Copy link
Member Author

sberyozkin commented Jun 14, 2024

Just updated the error message a bit. The reason I think it is correct to enforce that the users set the correct JWT grant themselves is that, if the users wants in fact to use another grant, then sending an assertion alongside client_credentials , etc, would make no sense

@sberyozkin
Copy link
Member Author

Note, as far as JWT bearer grant is concerned, it is already supported at the OIDC token propagation/exchange level but where the assertion is already supplied dynamically.

@sberyozkin
Copy link
Member Author

Thanks @gastaldi, I'll keep it open till Monday evening in case Pedro might want to have a look too.

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 14, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit e6e18b4.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@sberyozkin sberyozkin merged commit bf7eb28 into quarkusio:main Jun 17, 2024
23 checks passed
@sberyozkin sberyozkin deleted the oidc_client_jwt_bearer_grant branch June 17, 2024 17:37
@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jun 17, 2024
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oidc kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Salesforce oauth_jwt_flow
2 participants