Class JwtAuthenticationMechanism
- java.lang.Object
-
- org.restheart.security.plugins.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>
-
-
Field Summary
Fields Modifier and Type Field Description static StringJWT_AUTH_HEADER_PREFIX
-
Constructor Summary
Constructors Constructor Description JwtAuthenticationMechanism()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConsumer(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(Map<String,Object> args)io.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, wait
-
Methods inherited from interface org.restheart.plugins.security.AuthMechanism
getMechanismName
-
-
-
-
Field Detail
-
JWT_AUTH_HEADER_PREFIX
public static final String JWT_AUTH_HEADER_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(Map<String,Object> args) throws ConfigurationException
- 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
public void addConsumer(Consumer<com.auth0.jwt.interfaces.DecodedJWT> extraJwtVerifier)
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-
-
-