-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
JwtGrantedAuthoritiesConverter
is handy in Resource Server for extracting each scope into individual GrantedAuthority
s:
Jwt jwt = Jwt.withTokenValue("token")
.claim("scope", "message:read message:write")
.header("alg", "none")
.build();
JwtGrantedAuthoritiesConverter converter = new JwtGrantedAuthoritiesConverter();
assertThat(converter.convert(jwt)).containsExactly(
new SimpleGrantedAuthority("SCOPE_message:read"),
new SimpleGrantedAuthority("SCOPE_message:write"));
It'd be nice if DefaultOAuth2UserService
did the same thing by default. Currently, it adds the OAuth2UserAuthority
to the list of granted authorities, so this ticket would serve to append several SimpleGrantedAuthority
s to that list.
Note that we should also keep #5349 in mind when completing this feature.
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