-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Error when using private_key_jwt authentication method #13476
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
Comments
Thanks, @benfonty. This looks like an oversight. I've prioritized it for the next maintenance release. |
Actually, I think my earlier analysis is incorrect.
To configure JwtBearerGrantRequestEntityConverter requestEntityConverter = new JwtBearerGrantRequestEntityConverter();
requestEntityConverter.setParametersConverter(new NimbusJwtClientAuthenticationParametersConverter(this::keyLookup)); Where Or, if you don't need to use a JWT for client authentication as well, you can choose a method that is supported out of the box. To summarize, you can address this error in one of two ways:
|
Thank you for the feedback. In the code I provided, this part:
We set the method resolveJwtAssertion, whose responsibility is to build the jwt we used for authentication. I have the feeling that the goal of the class That's why I am a little confused about the fact that we have to use There must be something I didn't understand here, can you provide some clarification? |
There are two assertions in the JWT Bearer grant type: The bearer assertion and the client assertion. The first is the grant and the second identifies the client.
This can be confusing, though, since the bearer assertion can be used to identify the client, making the client assertion redundant. This nuance is identified in the spec:
So, if you are using On the other hand, if your bearer assertion does not identify the client, then you should add a client assertion as well. This is when you would use |
I just made some tests using |
Glad you got it sorted out! Happy to have helped. |
Describe the bug
Upgrading our codebase to Spring Boot 3.1.1, we got an eror message when calling Salesforce API.
We use
private_key_jwt
authentication method.It seems that this is a consequence of #13240
We found a workaround bypassing the decorator:
After bypassing the decorator it works well, as before the modification.
To Reproduce
Here is the configuration of our security:
The text was updated successfully, but these errors were encountered: