-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Labels
in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancementA general enhancement
Milestone
Description
Related to #6945
It would be nice if an application could indicate a custom claim name for GrantedAuthoritys without creating a custom converter.
Something like:
JwtGrantedAuthoritiesConverter converter = new JwtGrantedAuthoritiesConverter();
converter.setAuthoritiesClaimName("authorities");Would be easier to do than:
Converter<Jwt, List<GrantedAuthorities>> converter = jwt -> {
List<String> authorities = (List<String>) jwt.getClaim("authorities");
return authorities.stream()
.map(authority -> "SCOPE_" + authority)
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());
};So, let's add a setter to JwtGrantedAuthoritiesConverter called setAuthoritiesClaimName so that the converter knows which claim to look for.
Metadata
Metadata
Assignees
Labels
in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: enhancementA general enhancementA general enhancement