Class Authenticator.Context

java.lang.Object
org.elasticsearch.xpack.security.authc.Authenticator.Context
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing interface:
Authenticator

public static class Authenticator.Context extends Object implements Closeable
This class is a container to encapsulate the current request and other necessary information (mostly configuration related) required for authentication. It is instantiated for every incoming request and passed around to AuthenticatorChain and subsequently all Authenticator.
  • Constructor Details

    • Context

      public Context(org.elasticsearch.common.util.concurrent.ThreadContext threadContext, org.elasticsearch.xpack.security.authc.AuthenticationService.AuditableRequest request, org.elasticsearch.xpack.core.security.user.User fallbackUser, boolean allowAnonymous, Realms realms)
  • Method Details

    • getThreadContext

      public org.elasticsearch.common.util.concurrent.ThreadContext getThreadContext()
    • getRequest

      public org.elasticsearch.xpack.security.authc.AuthenticationService.AuditableRequest getRequest()
    • getFallbackUser

      public org.elasticsearch.xpack.core.security.user.User getFallbackUser()
    • isAllowAnonymous

      public boolean isAllowAnonymous()
    • setHandleNullToken

      public void setHandleNullToken(boolean value)
    • shouldHandleNullToken

      public boolean shouldHandleNullToken()
    • getUnsuccessfulMessages

      public List<String> getUnsuccessfulMessages()
    • addAuthenticationToken

      public void addAuthenticationToken(org.elasticsearch.xpack.core.security.authc.AuthenticationToken authenticationToken)
    • getMostRecentAuthenticationToken

      @Nullable public org.elasticsearch.xpack.core.security.authc.AuthenticationToken getMostRecentAuthenticationToken()
    • getBearerString

      public org.elasticsearch.common.settings.SecureString getBearerString()
    • getDefaultOrderedRealmList

      public List<org.elasticsearch.xpack.core.security.authc.Realm> getDefaultOrderedRealmList()
    • getUnlicensedRealms

      public List<org.elasticsearch.xpack.core.security.authc.Realm> getUnlicensedRealms()
    • addUnsuccessfulMessage

      public void addUnsuccessfulMessage(String message)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException