Class JwtAuthenticationConverter

java.lang.Object
com.codename1.backend.security.oauth2.server.resource.JwtAuthenticationConverter
All Implemented Interfaces:
Converter<Jwt, AbstractAuthenticationToken>

public final class JwtAuthenticationConverter extends Object implements Converter<Jwt, AbstractAuthenticationToken>

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)));
  • Constructor Details

    • JwtAuthenticationConverter

      public JwtAuthenticationConverter()
  • Method Details