Class AuthenticatorMechanismWrapper

java.lang.Object
org.restheart.security.handlers.AuthenticatorMechanismWrapper
All Implemented Interfaces:
io.undertow.security.api.AuthenticationMechanism, ConfigurablePlugin, Plugin, AuthMechanism

public class AuthenticatorMechanismWrapper extends Object implements AuthMechanism
log the wapped AuthenticatorMechanism outcomes and makes sure that it can't fail the whole authetication process if it doesn't authenticate the request. when multiple AuthenticatorMechanism are defined, the standard undertow authentication process is: As an in-bound request is received the authenticate method is called on each mechanism in turn until one of the following occurs:
- A mechanism successfully authenticates the incoming request.
- A mechanism attempts but fails to authenticate the request.
- The list of mechanisms is exhausted. * See http://undertow.io/javadoc/2.0.x/io/undertow/security/api/AuthenticationMechanism.html The restheart-security process is: As an in-bound request is received the authenticate method is called on each mechanism in turn until one of the following occurs:
- A mechanism successfully authenticates the incoming request.
- The list of mechanisms is exhausted.
this is achieved avoiding the wrapper AuthenticationMechanism to return NOT_AUTHENTICATED replacing the return value with NOT_ATTEMPTED
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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome
    authenticate(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext)
     
     
    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.ConfigurablePlugin

    arg, argOrDefault
  • Constructor Details

    • AuthenticatorMechanismWrapper

      public AuthenticatorMechanismWrapper(AuthMechanism wrapped)
  • Method Details

    • authenticate

      public io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext)
      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
    • getMechanismName

      public String getMechanismName()
      Specified by:
      getMechanismName in interface AuthMechanism