Class JwtTokenValidator
java.lang.Object
io.micronaut.security.token.jwt.validator.JwtTokenValidator
- All Implemented Interfaces:
 io.micronaut.core.order.Ordered,TokenValidator
- Since:
 - 1.0
 - Author:
 - Sergio del Amo
 - See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JwtAuthenticationFactoryprotected final JwtValidatorFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE - 
Constructor Summary
ConstructorsConstructorDescriptionJwtTokenValidator(JwtValidator validator, JwtAuthenticationFactory jwtAuthenticationFactory) JwtTokenValidator(Collection<SignatureConfiguration> signatureConfigurations, Collection<EncryptionConfiguration> encryptionConfigurations, Collection<GenericJwtClaimsValidator> genericJwtClaimsValidators, JwtAuthenticationFactory jwtAuthenticationFactory) Constructor. - 
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<Authentication>validateToken(String token, io.micronaut.http.HttpRequest<?> request) Validates the provided token and returns the authentication state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.order.Ordered
getOrder 
- 
Field Details
- 
jwtAuthenticationFactory
 - 
validator
 
 - 
 - 
Constructor Details
- 
JwtTokenValidator
@Inject public JwtTokenValidator(Collection<SignatureConfiguration> signatureConfigurations, Collection<EncryptionConfiguration> encryptionConfigurations, Collection<GenericJwtClaimsValidator> genericJwtClaimsValidators, JwtAuthenticationFactory jwtAuthenticationFactory) Constructor.- Parameters:
 signatureConfigurations- List of Signature configurations which are used to attempt validation.encryptionConfigurations- List of Encryption configurations which are used to attempt validation.genericJwtClaimsValidators- Generic JWT Claims validators which should be used to validate any JWT.jwtAuthenticationFactory- Utility to generate an Authentication given a JWT.
 - 
JwtTokenValidator
- Parameters:
 validator- Validates the JWTjwtAuthenticationFactory- The authentication factory
 
 - 
 - 
Method Details
- 
validateToken
public org.reactivestreams.Publisher<Authentication> validateToken(String token, @Nullable io.micronaut.http.HttpRequest<?> request) Description copied from interface:TokenValidatorValidates the provided token and returns the authentication state.- Specified by:
 validateTokenin interfaceTokenValidator- Parameters:
 token- The token string.request- The current request (or null)- Returns:
 - Publishes 
Authenticationbased on the JWT or empty if the validation fails. 
 
 -