Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class JwtAuthenticationConverter
- Object
- JwtAuthenticationConverter
Makes the JwtAuthenticationToken of a verified token: its authorities,
through a JwtGrantedAuthoritiesConverter unless another is set, and its
name, from the sub claim unless another is named.
JwtAuthenticationConverter converter = new JwtAuthenticationConverter();
converter.setPrincipalClaimName("preferred_username");
http.oauth2ResourceServer(o -> o.jwt(jwt -> jwt.jwtAuthenticationConverter(converter)));Constructors
public JwtAuthenticationConverter() |
Methods
Inherited methods
Constructor details
JwtAuthenticationConverter
public JwtAuthenticationConverter()Method details
setJwtGrantedAuthoritiesConverter
public void setJwtGrantedAuthoritiesConverter(Converter<Jwt, Collection<GrantedAuthority>> jwtGrantedAuthoritiesConverter)What reads the authorities out of a token.
setPrincipalClaimName
public void setPrincipalClaimName(String principalClaimName)The claim
Authentication.getName() answers with; sub unless set.convert
public AbstractAuthenticationToken convert(Jwt jwt)What
source becomes; null when it becomes nothing.