public final class MappingJwtGrantedAuthoritiesConverter extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
GrantedAuthoritys from scope attributes typically found in a
Jwt.| Constructor and Description |
|---|
MappingJwtGrantedAuthoritiesConverter() |
| Modifier and Type | Method and Description |
|---|---|
Collection<org.springframework.security.core.GrantedAuthority> |
convert(org.springframework.security.oauth2.jwt.Jwt jwt)
Extract
GrantedAuthoritys from the given Jwt. |
void |
setAuthoritiesClaimName(String authoritiesClaimName)
Sets the name of token claim to use for mapping
authorities by this converter. |
void |
setAuthoritiesMapping(Map<String,String> authoritiesMapping)
Set the mapping from resolved authorities from jwt into granted authorities.
|
void |
setAuthorityPrefix(String authorityPrefix)
Sets the prefix to use for
authorities mapped by this converter. |
public MappingJwtGrantedAuthoritiesConverter()
public Collection<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt)
GrantedAuthoritys from the given Jwt.convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>jwt - The Jwt tokenauthorities read from the token scopespublic void setAuthorityPrefix(String authorityPrefix)
authorities mapped by this converter.
Defaults to JwtGrantedAuthoritiesConverter#DEFAULT_AUTHORITY_PREFIX.authorityPrefix - The authority prefixpublic void setAuthoritiesClaimName(String authoritiesClaimName)
authorities by this converter.
Defaults to JwtGrantedAuthoritiesConverter#WELL_KNOWN_AUTHORITIES_CLAIM_NAMES.authoritiesClaimName - The token claim name to map authoritiesCopyright © 2020 Pivotal Software, Inc.. All rights reserved.