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
    Modifier and Type
    Field
    Description
    static String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome
    authenticate​(io.undertow.server.HttpServerExchange hse, io.undertow.security.api.SecurityContext sc)
     
    void
    init​(Map<String,​Object> args)
     
    io.undertow.security.api.AuthenticationMechanism.ChallengeResult
    sendChallenge​(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 Details

  • Constructor Details

    • JwtAuthenticationMechanism

      public JwtAuthenticationMechanism()
  • Method Details

    • 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:
      authenticate in interface io.undertow.security.api.AuthenticationMechanism
      Specified by:
      authenticate in interface AuthMechanism
    • sendChallenge

      public io.undertow.security.api.AuthenticationMechanism.ChallengeResult sendChallenge(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext)
      Specified by:
      sendChallenge in interface io.undertow.security.api.AuthenticationMechanism
      Specified by:
      sendChallenge in interface AuthMechanism
    • 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:
      addConsumer in interface ConsumingPlugin<com.auth0.jwt.interfaces.DecodedJWT>
      Parameters:
      extraJwtVerifier -