Class SecondaryAuthenticator
java.lang.Object
org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator
Performs "secondary user authentication" (that is, a second user, _not_ second factor authentication).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe term "Authorization" in the header value is to mimic the standard HTTP "Authorization" header -
Constructor Summary
ConstructorsConstructorDescriptionSecondaryAuthenticator(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.common.util.concurrent.ThreadContext threadContext, AuthenticationService authenticationService) SecondaryAuthenticator(org.elasticsearch.xpack.core.security.SecurityContext securityContext, AuthenticationService authenticationService) -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(String action, org.elasticsearch.transport.TransportRequest request, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.support.SecondaryAuthentication> listener) voidauthenticateAndAttachToContext(org.elasticsearch.rest.RestRequest request, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.support.SecondaryAuthentication> listener) booleanChecks whether this thread context provides secondary authentication credentials.
-
Field Details
-
SECONDARY_AUTH_HEADER_NAME
The term "Authorization" in the header value is to mimic the standard HTTP "Authorization" header- See Also:
-
-
Constructor Details
-
SecondaryAuthenticator
public SecondaryAuthenticator(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.common.util.concurrent.ThreadContext threadContext, AuthenticationService authenticationService) -
SecondaryAuthenticator
public SecondaryAuthenticator(org.elasticsearch.xpack.core.security.SecurityContext securityContext, AuthenticationService authenticationService)
-
-
Method Details
-
authenticate
public void authenticate(String action, org.elasticsearch.transport.TransportRequest request, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.support.SecondaryAuthentication> listener) - Parameters:
listener- Handler for theSecondaryAuthenticationobject. If the secondary authentication credentials do not exist the thread context, theActionListener.onResponse(Object)method is called with anullauthentication value. If the secondary authentication credentials are found in the thread context, but fail to be authenticated, then the failure is returned throughActionListener.onFailure(Exception).
-
authenticateAndAttachToContext
public void authenticateAndAttachToContext(org.elasticsearch.rest.RestRequest request, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.support.SecondaryAuthentication> listener) - Parameters:
listener- Handler for theSecondaryAuthenticationobject. If the secondary authentication credentials do not exist the thread context, theActionListener.onResponse(Object)method is called with anullauthentication value. If the secondary authentication credentials are found in the thread context, but fail to be authenticated, then the failure is returned throughActionListener.onFailure(Exception).
-
hasSecondaryAuthenticationHeader
public boolean hasSecondaryAuthenticationHeader()Checks whether this thread context provides secondary authentication credentials. This does not check whether the header contains valid credentials - you must callauthenticateAndAttachToContext(org.elasticsearch.rest.RestRequest, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.support.SecondaryAuthentication>)to validate the header.- Returns:
trueif a secondary authentication header exists in the thread context.
-