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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAuthnError.BuilderA fluent builder forAuthnErrorinstances.
-
Constructor Summary
Constructors Constructor Description AuthnError()Create a new instance.AuthnError(int httpStatus, String code, String message)Create an instance with the specified parameters.AuthnError(int httpStatus, String code, String message, List<AuthnErrorDetail> details)Create an instance with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCode()Get the error code.List<AuthnErrorDetail>getDetails()Get the error details.intgetHttpStatus()Get the HTTP status code.StringgetMessage()Get the developer-facing error message.StringgetState()Get the cookieless state value.StringgetUserMessage()Get the user-facing error message.StringgetUserMessageKey()Get the user-facing error message key.voidsetCode(String code)Set the error code.voidsetDetails(List<AuthnErrorDetail> details)Set the error details.voidsetHttpStatus(int httpStatus)Set the HTTP status code.voidsetMessage(String message)Set the developer-facing error message.voidsetState(String state)Set the cookieless state value.voidsetUserMessage(String userMessage)Directly set the localized user-facing error message.voidsetUserMessageKey(String userMessageKey)Set the user-facing error message key.
-
-
-
Constructor Detail
-
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 Detail
-
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 withsetUserMessageKey()or the localized error message can be directly set withsetUserMessage().
-
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:
getStatein interfaceWithStateAttributeSupport- Returns:
- the cookieless state value or null
- Since:
- 12.1
-
setState
public void setState(String state)
Set the cookieless state value.- Specified by:
setStatein interfaceWithStateAttributeSupport- Parameters:
state- the cookieless state value- Since:
- 12.1
-
-