Class JwtAuthenticationConverter

java.lang.Object
org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<Jwt, AbstractAuthenticationToken>

public class JwtAuthenticationConverter extends Object implements org.springframework.core.convert.converter.Converter<Jwt, AbstractAuthenticationToken>
Since:
5.1
  • Constructor Details

    • JwtAuthenticationConverter

      public JwtAuthenticationConverter()
  • Method Details

    • convert

      public final AbstractAuthenticationToken convert(Jwt jwt)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<Jwt, AbstractAuthenticationToken>
    • setJwtPrincipalConverter

      public void setJwtPrincipalConverter(org.springframework.core.convert.converter.Converter<Jwt, OAuth2AuthenticatedPrincipal> jwtPrincipalConverter)
      Sets the Converter<Jwt, OAuth2AuthenticatedPrincipal> to use.
      Parameters:
      jwtPrincipalConverter - The converter
      Since:
      7.1
    • setJwtGrantedAuthoritiesConverter

      public void setJwtGrantedAuthoritiesConverter(org.springframework.core.convert.converter.Converter<Jwt, Collection<GrantedAuthority>> jwtGrantedAuthoritiesConverter)
      Sets the Converter<Jwt, Collection<GrantedAuthority>> to use. Defaults to JwtGrantedAuthoritiesConverter.
      Parameters:
      jwtGrantedAuthoritiesConverter - The converter
      Since:
      5.2
      See Also:
    • setPrincipalClaimName

      public void setPrincipalClaimName(String principalClaimName)
      Sets the principal claim name. Defaults to JwtClaimNames.SUB.
      Parameters:
      principalClaimName - The principal claim name
      Since:
      5.4