-
Notifications
You must be signed in to change notification settings - Fork 6k
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
JwtGrantedAuthoritiesConverter should allow configuring the authorities claim name #7100
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: enhancement
A general enhancement
Milestone
Comments
This was referenced Jul 13, 2019
This was referenced Jul 13, 2019
@andifalk, it's yours! |
andifalk
added a commit
to andifalk/spring-security
that referenced
this issue
Aug 18, 2019
Prior to this change authorities are always mapped using well known claim names ('scope' or 'scp'). To change this default behaviour the converter had to be replaced completely with a custom one. This commit adds an additional setter to configure a custom claim name like e.g. 'roles'. Without specifying a custom claim name the default claims to be used still remains to the well known ones. This way the authorities can be mapped according to customized token claims. Fixes spring-projectsgh-7100
jzheaux
pushed a commit
that referenced
this issue
Aug 20, 2019
Prior to this change authorities are always mapped using well known claim names ('scope' or 'scp'). To change this default behaviour the converter had to be replaced completely with a custom one. This commit adds an additional setter to configure a custom claim name like e.g. 'roles'. Without specifying a custom claim name the default claims to be used still remains to the well known ones. This way the authorities can be mapped according to customized token claims. Fixes gh-7100
kostya05983
pushed a commit
to kostya05983/spring-security
that referenced
this issue
Aug 26, 2019
Prior to this change authorities are always mapped using well known claim names ('scope' or 'scp'). To change this default behaviour the converter had to be replaced completely with a custom one. This commit adds an additional setter to configure a custom claim name like e.g. 'roles'. Without specifying a custom claim name the default claims to be used still remains to the well known ones. This way the authorities can be mapped according to customized token claims. Fixes spring-projectsgh-7100
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: enhancement
A general enhancement
Related to #6945
It would be nice if an application could indicate a custom claim name for
GrantedAuthority
s without creating a custom converter.Something like:
Would be easier to do than:
So, let's add a setter to
JwtGrantedAuthoritiesConverter
calledsetAuthoritiesClaimName
so that the converter knows which claim to look for.The text was updated successfully, but these errors were encountered: