Class DefaultJwtAuthenticationFactory

java.lang.Object
io.micronaut.security.token.AbstractTokenAuthenticationFactory<com.nimbusds.jwt.JWT>
io.micronaut.security.token.jwt.validator.DefaultJwtAuthenticationFactory
All Implemented Interfaces:
JwtAuthenticationFactory, io.micronaut.security.token.TokenAuthenticationFactory<com.nimbusds.jwt.JWT>

@Singleton public class DefaultJwtAuthenticationFactory extends io.micronaut.security.token.AbstractTokenAuthenticationFactory<com.nimbusds.jwt.JWT> implements JwtAuthenticationFactory
Extracts the JWT claims and uses the AuthenticationJWTClaimsSetAdapter to construction an Authentication object.
Since:
1.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultJwtAuthenticationFactory(io.micronaut.security.token.config.TokenConfiguration tokenConfiguration, io.micronaut.security.token.RolesFinder rolesFinder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<io.micronaut.security.authentication.Authentication>
    createAuthentication(com.nimbusds.jwt.JWT token)
     

    Methods inherited from class io.micronaut.security.token.AbstractTokenAuthenticationFactory

    createAuthentication, usernameForClaims

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultJwtAuthenticationFactory

      public DefaultJwtAuthenticationFactory(io.micronaut.security.token.config.TokenConfiguration tokenConfiguration, io.micronaut.security.token.RolesFinder rolesFinder)
      Parameters:
      tokenConfiguration - Token Configuration
      rolesFinder - Utility to retrieve roles from token claims
  • Method Details

    • createAuthentication

      public Optional<io.micronaut.security.authentication.Authentication> createAuthentication(com.nimbusds.jwt.JWT token)
      Specified by:
      createAuthentication in interface JwtAuthenticationFactory
      Specified by:
      createAuthentication in interface io.micronaut.security.token.TokenAuthenticationFactory<com.nimbusds.jwt.JWT>