Class AuthenticationResult
java.lang.Object
com.mirth.connect.plugins.httpauth.userutil.AuthenticationResult
This class represents the result of an HTTP authentication attempt, used to accept or reject
requests coming into HTTP-based source connectors.
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationResult(AuthStatus status) Instantiates a new AuthenticationResult object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponseHeader(String key, String value) Adds a new response header to be sent along with the authentication response.static AuthenticationResultChallenged(String authenticateHeader) Convenience method to create a new AuthenticationResult with the CHALLENGED status.static AuthenticationResultFailure()Convenience method to create a new AuthenticationResult with the FAILURE status.getRealm()Returns the realm that the request has been authenticated with.Returns the map of HTTP headers to be sent along with the authentication response.Returns the accept/reject status of the authentication attempt.Returns the username that the request has been authenticated with.voidSets the realm that the request has been authenticated with.voidsetResponseHeaders(Map<String, List<String>> responseHeaders) Sets the map of HTTP headers to be sent along with the authentication response.voidsetStatus(AuthStatus status) Sets the accept/reject status of the authentication attempt.voidsetUsername(String username) Sets the username that the request has been authenticated with.static AuthenticationResultSuccess()Convenience method to create a new AuthenticationResult with the SUCCESS status.static AuthenticationResultConvenience method to create a new AuthenticationResult with the SUCCESS status.
-
Constructor Details
-
AuthenticationResult
Instantiates a new AuthenticationResult object.- Parameters:
status- The accept/reject status to use.
-
-
Method Details
-
getStatus
Returns the accept/reject status of the authentication attempt.- Returns:
- The accept/reject status of the authentication attempt.
-
setStatus
Sets the accept/reject status of the authentication attempt.- Parameters:
status- The accept/reject status to use.
-
getUsername
Returns the username that the request has been authenticated with.- Returns:
- The username that the request has been authenticated with.
-
setUsername
Sets the username that the request has been authenticated with.- Parameters:
username- The username that the request has been authenticated with.
-
getRealm
Returns the realm that the request has been authenticated with.- Returns:
- The realm that the request has been authenticated with.
-
setRealm
Sets the realm that the request has been authenticated with.- Parameters:
realm- The realm that the request has been authenticated with.
-
getResponseHeaders
Returns the map of HTTP headers to be sent along with the authentication response.- Returns:
- The map of HTTP headers to be sent along with the authentication response.
-
setResponseHeaders
Sets the map of HTTP headers to be sent along with the authentication response.- Parameters:
responseHeaders- The map of HTTP headers to be sent along with the authentication response.
-
addResponseHeader
Adds a new response header to be sent along with the authentication response.- Parameters:
key- The name of the header.value- The value of the header.
-
Challenged
Convenience method to create a new AuthenticationResult with the CHALLENGED status.- Parameters:
authenticateHeader- The value to include in the WWW-Authenticate response header.- Returns:
- The created AuthenticationResult object.
-
Success
Convenience method to create a new AuthenticationResult with the SUCCESS status.- Returns:
- The created AuthenticationResult object.
-
Success
Convenience method to create a new AuthenticationResult with the SUCCESS status.- Parameters:
username- The username that the request has been authenticated with.realm- The realm that the request has been authenticated with.- Returns:
- The created AuthenticationResult object.
-
Failure
Convenience method to create a new AuthenticationResult with the FAILURE status.- Returns:
- The created AuthenticationResult object.
-