Class AuthenticationResult

java.lang.Object
com.mirth.connect.plugins.httpauth.userutil.AuthenticationResult

public class AuthenticationResult extends Object
This class represents the result of an HTTP authentication attempt, used to accept or reject requests coming into HTTP-based source connectors.
  • Constructor Details

    • AuthenticationResult

      public AuthenticationResult(AuthStatus status)
      Instantiates a new AuthenticationResult object.
      Parameters:
      status - The accept/reject status to use.
  • Method Details

    • getStatus

      public AuthStatus getStatus()
      Returns the accept/reject status of the authentication attempt.
      Returns:
      The accept/reject status of the authentication attempt.
    • setStatus

      public void setStatus(AuthStatus status)
      Sets the accept/reject status of the authentication attempt.
      Parameters:
      status - The accept/reject status to use.
    • getUsername

      public String getUsername()
      Returns the username that the request has been authenticated with.
      Returns:
      The username that the request has been authenticated with.
    • setUsername

      public void setUsername(String username)
      Sets the username that the request has been authenticated with.
      Parameters:
      username - The username that the request has been authenticated with.
    • getRealm

      public String getRealm()
      Returns the realm that the request has been authenticated with.
      Returns:
      The realm that the request has been authenticated with.
    • setRealm

      public void setRealm(String realm)
      Sets the realm that the request has been authenticated with.
      Parameters:
      realm - The realm that the request has been authenticated with.
    • getResponseHeaders

      public Map<String,List<String>> 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

      public void setResponseHeaders(Map<String,List<String>> responseHeaders)
      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

      public void addResponseHeader(String key, String value)
      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

      public static AuthenticationResult Challenged(String authenticateHeader)
      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

      public static AuthenticationResult Success()
      Convenience method to create a new AuthenticationResult with the SUCCESS status.
      Returns:
      The created AuthenticationResult object.
    • Success

      public static AuthenticationResult Success(String username, String realm)
      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

      public static AuthenticationResult Failure()
      Convenience method to create a new AuthenticationResult with the FAILURE status.
      Returns:
      The created AuthenticationResult object.