public class ExternalOauth2ResourceAuthoritiesMapper extends Object implements AuthoritiesMapper
AuthoritiesMapper that looks up
CoreSecurityRoles from an external HTTP resource. Requests to the
external HTTP resource are authenticated by forwarding the user's access
token. The external resource's response body MUST be a JSON array
containing strings with values corresponding to
CoreSecurityRoles.key values. For example, a response containing
["VIEW", "CREATE"] would grant the user
ROLE_VIEW, ROLE_CREATE,| Modifier and Type | Field and Description |
|---|---|
static org.springframework.security.core.GrantedAuthority |
CREATE |
static org.springframework.security.core.GrantedAuthority |
DEPLOY |
static org.springframework.security.core.GrantedAuthority |
DESTROY |
static org.springframework.security.core.GrantedAuthority |
MANAGE |
static org.springframework.security.core.GrantedAuthority |
MODIFY |
static org.springframework.security.core.GrantedAuthority |
SCHEDULE |
static org.springframework.security.core.GrantedAuthority |
VIEW |
| Constructor and Description |
|---|
ExternalOauth2ResourceAuthoritiesMapper(URI roleProviderUri) |
| Modifier and Type | Method and Description |
|---|---|
Set<org.springframework.security.core.GrantedAuthority> |
mapScopesToAuthorities(String providerId,
Set<String> scopes,
String token)
Map the provided Scopes to authorities.
|
public static final org.springframework.security.core.GrantedAuthority CREATE
public static final org.springframework.security.core.GrantedAuthority DEPLOY
public static final org.springframework.security.core.GrantedAuthority DESTROY
public static final org.springframework.security.core.GrantedAuthority MANAGE
public static final org.springframework.security.core.GrantedAuthority MODIFY
public static final org.springframework.security.core.GrantedAuthority SCHEDULE
public static final org.springframework.security.core.GrantedAuthority VIEW
public ExternalOauth2ResourceAuthoritiesMapper(URI roleProviderUri)
roleProviderUri - a HTTP GET request is sent to this URI to fetch
the user's security rolespublic Set<org.springframework.security.core.GrantedAuthority> mapScopesToAuthorities(String providerId, Set<String> scopes, String token)
AuthoritiesMappermapScopesToAuthorities in interface AuthoritiesMapperproviderId - If null, then the default providerId is usedscopes - the scopes to maptoken - some implementation may need to make additional requestsCopyright © 2020 Pivotal Software, Inc.. All rights reserved.