Class AuthnError

java.lang.Object
com.pingidentity.sdk.api.authn.model.AuthnError
All Implemented Interfaces:
WithStateAttributeSupport

public class AuthnError extends Object implements WithStateAttributeSupport
The authentication API model representing an error of some kind.
Since:
9.3
  • Constructor Details

    • AuthnError

      public AuthnError()
      Create a new instance.
    • AuthnError

      public AuthnError(int httpStatus, String code, String message)
      Create an instance with the specified parameters.
      Parameters:
      httpStatus - The HTTP status code.
      code - The error code string.
      message - The error message.
    • AuthnError

      public AuthnError(int httpStatus, String code, String message, List<AuthnErrorDetail> details)
      Create an instance with the specified parameters.
      Parameters:
      httpStatus - The HTTP status code.
      code - The error code string.
      message - The error message.
      details - The details of the error.
  • Method Details

    • getHttpStatus

      public int getHttpStatus()
      Get the HTTP status code.
    • setHttpStatus

      public void setHttpStatus(int httpStatus)
      Set the HTTP status code.
    • getCode

      public String getCode()
      Get the error code.
    • setCode

      public void setCode(String code)
      Set the error code.
    • getMessage

      public String getMessage()
      Get the developer-facing error message.
    • setMessage

      public void setMessage(String message)
      Set the developer-facing error message.
    • getUserMessage

      public String getUserMessage()
      Get the user-facing error message. A user-facing error message should be provided for any error likely to be displayed to the end user. A localizable message key can be provided with setUserMessageKey() or the localized error message can be directly set with setUserMessage().
    • setUserMessageKey

      public void setUserMessageKey(String userMessageKey)
      Set the user-facing error message key. In the JSON serialization this key will automatically be converted to a localized string if a corresponding message is defined in the authn-api-messages properties file for the user's locale.
    • getUserMessageKey

      public String getUserMessageKey()
      Get the user-facing error message key.
    • setUserMessage

      public void setUserMessage(String userMessage)
      Directly set the localized user-facing error message.
    • getDetails

      public List<AuthnErrorDetail> getDetails()
      Get the error details.
    • setDetails

      public void setDetails(List<AuthnErrorDetail> details)
      Set the error details.
    • getState

      public String getState()
      Get the cookieless state value.
      Specified by:
      getState in interface WithStateAttributeSupport
      Returns:
      the cookieless state value or null
      Since:
      12.1
    • setState

      public void setState(String state)
      Set the cookieless state value.
      Specified by:
      setState in interface WithStateAttributeSupport
      Parameters:
      state - the cookieless state value
      Since:
      12.1