public interface AuthoritiesProvider
GrantedAuthoritys to be added to the current OAuth Principal. Multiple implementations
are allowed, by default OAuth scopes are converted to Authorities with the format SCOPE_<scope-name> and
if a `groups` claim exists in the access or id token, those are converted as well.
Example usage:
@Bean
AuthoritiesProvider myCustomAuthoritiesProvider() {
return (user, userRequest) -> lookupExtraAuthoritesByName(user.getAttributes().get("email"));
}
| Modifier and Type | Method and Description |
|---|---|
Collection<? extends org.springframework.security.core.GrantedAuthority> |
getAuthorities(org.springframework.security.oauth2.core.user.OAuth2User user,
org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest userRequest) |
default Collection<? extends org.springframework.security.core.GrantedAuthority> |
getAuthorities(org.springframework.security.oauth2.core.oidc.user.OidcUser user,
org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest userRequest) |
Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities(org.springframework.security.oauth2.core.user.OAuth2User user, org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest userRequest)
default Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities(org.springframework.security.oauth2.core.oidc.user.OidcUser user, org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest userRequest)
Copyright © 2017–2020 Okta. All rights reserved.