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