public class JwtAuthenticationConverter extends java.lang.Object implements org.springframework.core.convert.converter.Converter<Jwt,AbstractAuthenticationToken>
Constructor and Description |
---|
JwtAuthenticationConverter() |
Modifier and Type | Method and Description |
---|---|
AbstractAuthenticationToken |
convert(Jwt jwt) |
protected java.util.Collection<GrantedAuthority> |
extractAuthorities(Jwt jwt)
Deprecated.
Since 5.2. Use your own custom converter instead
|
void |
setJwtGrantedAuthoritiesConverter(org.springframework.core.convert.converter.Converter<Jwt,java.util.Collection<GrantedAuthority>> jwtGrantedAuthoritiesConverter)
Sets the
Converter<Jwt, Collection<GrantedAuthority>>
to use. |
void |
setPrincipalClaimName(java.lang.String principalClaimName)
Sets the principal claim name.
|
public final AbstractAuthenticationToken convert(Jwt jwt)
convert
in interface org.springframework.core.convert.converter.Converter<Jwt,AbstractAuthenticationToken>
@Deprecated protected java.util.Collection<GrantedAuthority> extractAuthorities(Jwt jwt)
GrantedAuthority
s from scope attributes typically found in a
Jwt
jwt
- The tokenGrantedAuthority
s found on the tokenJwtGrantedAuthoritiesConverter
,
setJwtGrantedAuthoritiesConverter(Converter)
public void setJwtGrantedAuthoritiesConverter(org.springframework.core.convert.converter.Converter<Jwt,java.util.Collection<GrantedAuthority>> jwtGrantedAuthoritiesConverter)
Converter<Jwt, Collection<GrantedAuthority>>
to use. Defaults to JwtGrantedAuthoritiesConverter
.jwtGrantedAuthoritiesConverter
- The converterJwtGrantedAuthoritiesConverter
public void setPrincipalClaimName(java.lang.String principalClaimName)
JwtClaimNames.SUB
.principalClaimName
- The principal claim name