Class JwtAuthConverter

java.lang.Object
org.trustdeck.security.authentication.configuration.JwtAuthConverter
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>

@Component public class JwtAuthConverter extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
This class is used to convert a JWT token into readable information. It extracts role names and the preferred username.
Author:
Eric Wündisch and Armin Müller
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new converter with the given properties.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.authentication.AbstractAuthenticationToken
    convert(org.springframework.security.oauth2.jwt.Jwt jwt)
    Method to convert from JSON Web Token (JWT) to an AbstractAuthenticationToken.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.core.convert.converter.Converter

    andThen
  • Constructor Details

    • JwtAuthConverter

      public JwtAuthConverter(JwtProperties jwtProperties)
      Instantiates a new converter with the given properties.
      Parameters:
      jwtProperties - the JWT properties
  • Method Details

    • convert

      public org.springframework.security.authentication.AbstractAuthenticationToken convert(org.springframework.security.oauth2.jwt.Jwt jwt)
      Method to convert from JSON Web Token (JWT) to an AbstractAuthenticationToken.
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>