Class DefaultJwtAuthenticationFactory

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<io.micronaut.security.authentication.Authentication> createAuthentication​(com.nimbusds.jwt.JWT token)  
      protected java.util.Optional<java.lang.String> usernameForClaims​(com.nimbusds.jwt.JWTClaimsSet claimSet)  
      • Methods inherited from class java.lang.Object

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

      • DefaultJwtAuthenticationFactory

        public DefaultJwtAuthenticationFactory​(io.micronaut.security.token.config.TokenConfiguration tokenConfiguration,
                                               io.micronaut.security.token.RolesFinder rolesFinder)
    • Method Detail

      • createAuthentication

        public java.util.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>
      • usernameForClaims

        protected java.util.Optional<java.lang.String> usernameForClaims​(com.nimbusds.jwt.JWTClaimsSet claimSet)
                                                                  throws java.text.ParseException
        Parameters:
        claimSet - JWT Claims
        Returns:
        the username defined by TokenConfiguration.getNameKey() ()} or the sub claim.
        Throws:
        java.text.ParseException - might be thrown parsing claims