Class JwtAuthenticationMechanism
java.lang.Object
org.restheart.security.mechanisms.JwtAuthenticationMechanism
- All Implemented Interfaces:
io.undertow.security.api.AuthenticationMechanism,org.restheart.plugins.ConfigurablePlugin,org.restheart.plugins.ConsumingPlugin<com.auth0.jwt.interfaces.DecodedJWT>,org.restheart.plugins.Plugin,org.restheart.plugins.security.AuthMechanism
public class JwtAuthenticationMechanism
extends Object
implements org.restheart.plugins.security.AuthMechanism, org.restheart.plugins.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) voidinit()io.undertow.security.api.AuthenticationMechanism.ChallengeResultsendChallenge(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext) protected static booleanvalidateKeyComplexity(String jwtKey) 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
public void init() throws org.restheart.configuration.ConfigurationException- Throws:
org.restheart.configuration.ConfigurationException
-
validateKeyComplexity
-
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 interfaceorg.restheart.plugins.security.AuthMechanism
-
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 interfaceorg.restheart.plugins.security.AuthMechanism
-
addConsumer
set an extra verification step via a Consumer that can throw JWTVerificationException to make the verification failing- Specified by:
addConsumerin interfaceorg.restheart.plugins.ConsumingPlugin<com.auth0.jwt.interfaces.DecodedJWT>- Parameters:
extraJwtVerifier-
-