Class DefaultJwtAuthenticator<P extends JwtClaimsSetPrincipal>

  • Type Parameters:
    P - Type of principal required
    All Implemented Interfaces:
    io.dropwizard.auth.Authenticator<com.nimbusds.jwt.JWT,​P>

    public class DefaultJwtAuthenticator<P extends JwtClaimsSetPrincipal>
    extends Object
    implements io.dropwizard.auth.Authenticator<com.nimbusds.jwt.JWT,​P>
    Default implementation of Authenticator which handles a most repeatable part, namely token validation against signatures and keys stored in remote Json Web Key Set. Present implementation does no rely on Nimbus's JWTClaimsSetVerifier API, rather uses decoration and delegation of calls to next implementation of JwtClaimsSetAuthenticator. TODO: consider built-in support for audience verification since its quite standard feature.
    Author:
    Ɓukasz Dywicki
    • Method Detail

      • authenticate

        public Optional<P> authenticate​(com.nimbusds.jwt.JWT credentials)
                                 throws io.dropwizard.auth.AuthenticationException
        Specified by:
        authenticate in interface io.dropwizard.auth.Authenticator<com.nimbusds.jwt.JWT,​P extends JwtClaimsSetPrincipal>
        Throws:
        io.dropwizard.auth.AuthenticationException