public final class JwtGrantedAuthoritiesConverter
extends java.lang.Object
implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>
GrantedAuthoritys from scope attributes typically found in a
Jwt.| Constructor and Description |
|---|
JwtGrantedAuthoritiesConverter() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<org.springframework.security.core.GrantedAuthority> |
convert(org.springframework.security.oauth2.jwt.Jwt jwt)
Extract
GrantedAuthoritys from the given Jwt. |
void |
setAuthoritiesClaimName(java.lang.String authoritiesClaimName)
Sets the name of token claim to use for mapping
authorities by this converter. |
void |
setAuthorityPrefix(java.lang.String authorityPrefix)
Sets the prefix to use for
authorities mapped by this
converter. |
public java.util.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,java.util.Collection<org.springframework.security.core.GrantedAuthority>>jwt - The Jwt tokenauthorities read from the token scopespublic void setAuthorityPrefix(java.lang.String authorityPrefix)
authorities mapped by this
converter. Defaults to
DEFAULT_AUTHORITY_PREFIX.authorityPrefix - The authority prefixpublic void setAuthoritiesClaimName(java.lang.String authoritiesClaimName)
authorities by this converter. Defaults to
WELL_KNOWN_AUTHORITIES_CLAIM_NAMES.authoritiesClaimName - The token claim name to map authorities