Class JwtAuthenticationMechanism
java.lang.Object
org.restheart.security.mechanisms.JwtAuthenticationMechanism
- All Implemented Interfaces:
io.undertow.security.api.AuthenticationMechanism,ConfigurablePlugin,ConsumingPlugin<com.auth0.jwt.interfaces.DecodedJWT>,Plugin,AuthMechanism
public class JwtAuthenticationMechanism
extends Object
implements AuthMechanism, ConsumingPlugin<com.auth0.jwt.interfaces.DecodedJWT>
factory for JWT AuthenticationMechanism
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.undertow.security.api.AuthenticationMechanism
io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome, io.undertow.security.api.AuthenticationMechanism.ChallengeResult -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsumer(Consumer<com.auth0.jwt.interfaces.DecodedJWT> extraJwtVerifier) set an extra verification step via a Consumer that can throw JWTVerificationException to make the verification failingio.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcomeauthenticate(io.undertow.server.HttpServerExchange hse, io.undertow.security.api.SecurityContext sc) voidio.undertow.security.api.AuthenticationMechanism.ChallengeResultsendChallenge(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.restheart.plugins.security.AuthMechanism
getMechanismNameMethods inherited from interface org.restheart.plugins.ConfigurablePlugin
arg, argOrDefault
-
Field Details
-
JWT_AUTH_HEADER_PREFIX
- See Also:
-
-
Constructor Details
-
JwtAuthenticationMechanism
public JwtAuthenticationMechanism()
-
-
Method Details
-
init
- Throws:
ConfigurationException
-
authenticate
public io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(io.undertow.server.HttpServerExchange hse, io.undertow.security.api.SecurityContext sc) - Specified by:
authenticatein interfaceio.undertow.security.api.AuthenticationMechanism- Specified by:
authenticatein interfaceAuthMechanism
-
sendChallenge
public io.undertow.security.api.AuthenticationMechanism.ChallengeResult sendChallenge(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext) - Specified by:
sendChallengein interfaceio.undertow.security.api.AuthenticationMechanism- Specified by:
sendChallengein interfaceAuthMechanism
-
addConsumer
set an extra verification step via a Consumer that can throw JWTVerificationException to make the verification failing- Specified by:
addConsumerin interfaceConsumingPlugin<com.auth0.jwt.interfaces.DecodedJWT>- Parameters:
extraJwtVerifier-
-