-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Adding 'audience' to ClientRegistration for OAuth2.0 client-credentials flow #7379
Comments
@j-chao The So assigning an I'm going to close this as answered. As an FYI, there is a way to customize the Access Token request for non-standard parameters ( |
@jgrandja some authorization servers like Auth0 mandates "audience" in the request body, if it is not there it returns "Non-global clients are not allowed access to APIv1" failure message. https://medium.com/@svkristof_86488/non-global-clients-are-not-allowed-access-to-apiv1-88877f1e855b The work around I did was to put property for each audience, all of them have the same key value except the last value should match registrationId, and I made the concatenation in my custom Converter<OAuth2ClientCredentialsGrantRequest, RequestEntity<?>> where I add "audience" as a form parameter. It works but it will be better if it is supported out-of-the-box from Spring Boot. |
Postman offers the possibility to customize the "audience" and "resource" parameters when requesting a token using the client-credentials flow. It shows that there is a need for such a feature. |
Yeah, I had the same problem. It would be great if this could be added to spring security, would've saved me a couple of hours of debugging, digging and frustration... If any one should require some assistance, let me know. I might be able to save you some time |
Please consider reopening this and implementing this feature. Especially since the 'status: invalid' label is invalid. |
Summary
There doesn't seem to be a way to specify the audience/resource server for a token request to an authorization server via client-credentials grant-type flow.
Actual Behavior
There is no way obvious way to define the audience of the token, when requesting for a token.
Expected Behavior
There should be a way to specify an 'aud' with the creation of the ClientRegistration object.
Configuration
Spring Boot 2.2.0.M4 project
Java 12
maven
Version
Spring Security 5.2.0.M3
Sample
The payload of the jwt token that is returned should contain the audience as specified in the request. ie:
Request:
Payload of returned JWT token:
The text was updated successfully, but these errors were encountered: