Class DefaultJwtAuthenticator<P extends JwtClaimsSetPrincipal>
- java.lang.Object
-
- org.connectorio.dropwizard.nimbus.auth.jwt.DefaultJwtAuthenticator<P>
-
- 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 ofAuthenticatorwhich 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'sJWTClaimsSetVerifierAPI, rather uses decoration and delegation of calls to next implementation ofJwtClaimsSetAuthenticator. TODO: consider built-in support for audience verification since its quite standard feature.- Author:
- Ćukasz Dywicki
-
-
Constructor Summary
Constructors Constructor Description DefaultJwtAuthenticator(JwtClaimsSetAuthenticator<P> delegate, String jwkSetUrl, com.nimbusds.jose.JWSAlgorithm signatureAlgorithm)DefaultJwtAuthenticator(JwtClaimsSetAuthenticator<P> delegate, URL jwkSetUrl, com.nimbusds.jose.JWSAlgorithm signatureAlgorithm)DefaultJwtAuthenticator(JwtClaimsSetAuthenticator<P> delegate, JwtConfiguration configuration)
-
-
-
Constructor Detail
-
DefaultJwtAuthenticator
public DefaultJwtAuthenticator(JwtClaimsSetAuthenticator<P> delegate, JwtConfiguration configuration)
-
DefaultJwtAuthenticator
public DefaultJwtAuthenticator(JwtClaimsSetAuthenticator<P> delegate, String jwkSetUrl, com.nimbusds.jose.JWSAlgorithm signatureAlgorithm)
-
DefaultJwtAuthenticator
public DefaultJwtAuthenticator(JwtClaimsSetAuthenticator<P> delegate, URL jwkSetUrl, com.nimbusds.jose.JWSAlgorithm signatureAlgorithm)
-
-
Method Detail
-
authenticate
public Optional<P> authenticate(com.nimbusds.jwt.JWT credentials) throws io.dropwizard.auth.AuthenticationException
- Specified by:
authenticatein interfaceio.dropwizard.auth.Authenticator<com.nimbusds.jwt.JWT,P extends JwtClaimsSetPrincipal>- Throws:
io.dropwizard.auth.AuthenticationException
-
-