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
ConstructorsConstructorDescriptionJwtAuthConverter(JwtProperties jwtProperties) Instantiates a new converter with the given properties. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.AbstractAuthenticationTokenconvert(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, waitMethods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Constructor Details
-
JwtAuthConverter
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:
convertin interfaceorg.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
-