public class ExternalOauth2ResourceAuthoritiesExtractor extends Object implements org.springframework.boot.autoconfigure.security.oauth2.resource.AuthoritiesExtractor
AuthoritiesExtractor 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 |
|---|
ExternalOauth2ResourceAuthoritiesExtractor(org.springframework.security.oauth2.client.OAuth2RestTemplate restTemplate,
URI roleProviderUri) |
| Modifier and Type | Method and Description |
|---|---|
List<org.springframework.security.core.GrantedAuthority> |
extractAuthorities(Map<String,Object> map) |
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 ExternalOauth2ResourceAuthoritiesExtractor(org.springframework.security.oauth2.client.OAuth2RestTemplate restTemplate,
URI roleProviderUri)
restTemplate - used for acquiring the user's access token and
requesting the user's security rolesroleProviderUri - a HTTP GET request is sent to this URI to fetch
the user's security rolesCopyright © 2019 Pivotal Software, Inc.. All rights reserved.