Module org.elasticsearch.xcore
Class AuthenticationResult<T>
java.lang.Object
org.elasticsearch.xpack.core.security.authc.AuthenticationResult<T>
Represents the result of an authentication attempt.
This allows a
Realm to respond in 3 different ways (without needing to
resort to ActionListener.onFailure(Exception))
- Successful authentication of a user
- Unable to authenticate user, try another realm (optionally with a diagnostic message)
- Unable to authenticate user, terminate authentication (with an error message)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetValue()booleanstatic <T> AuthenticationResult<T> Creates anAuthenticationResultthat indicates that the realm did not handle the authentication request in any way, and has no failure messages.static <T> AuthenticationResult<T> success(T value) Creates anAuthenticationResultthat indicates that the suppliedUserhas been successfully authenticated.static <T> AuthenticationResult<T> Creates a successful result, with optional metadatastatic <T> AuthenticationResult<T> Creates anAuthenticationResultthat indicates that the realm attempted to handle the authentication request, was unsuccessful and wants to terminate this authentication request.static <T> AuthenticationResult<T> Creates anAuthenticationResultthat indicates that the realm attempted to handle the authentication request, was unsuccessful and wants to terminate this authentication request.toString()static <T> AuthenticationResult<T> unsuccessful(String message, Exception cause) Creates anAuthenticationResultthat indicates that the realm attempted to handle the authentication request but was unsuccessful.
-
Field Details
-
THREAD_CONTEXT_KEY
-
-
Method Details
-
getStatus
-
getValue
-
getMessage
-
getException
-
getMetadata
-
success
Creates anAuthenticationResultthat indicates that the suppliedUserhas been successfully authenticated.The
statusis set toAuthenticationResult.Status.SUCCESS.- Parameters:
value- The user that was authenticated. Cannot benull.
-
success
Creates a successful result, with optional metadata- See Also:
-
notHandled
Creates anAuthenticationResultthat indicates that the realm did not handle the authentication request in any way, and has no failure messages.The
statusis set toAuthenticationResult.Status.CONTINUE. -
unsuccessful
Creates anAuthenticationResultthat indicates that the realm attempted to handle the authentication request but was unsuccessful. The reason for the failure is given in the supplied message and optional exception.The
statusis set toAuthenticationResult.Status.CONTINUE.The
valueis not populated. -
terminate
Creates anAuthenticationResultthat indicates that the realm attempted to handle the authentication request, was unsuccessful and wants to terminate this authentication request. The reason for the failure is given in the supplied message and optional exception.The
statusis set toAuthenticationResult.Status.TERMINATE.The
valueis not populated. -
terminate
Creates anAuthenticationResultthat indicates that the realm attempted to handle the authentication request, was unsuccessful and wants to terminate this authentication request. The reason for the failure is given in the supplied message.The
statusis set toAuthenticationResult.Status.TERMINATE.The
valueis not populated. -
isAuthenticated
public boolean isAuthenticated() -
toString
-