Class AuthnErrorSpec


  • public class AuthnErrorSpec
    extends Object
    A class which acts as a template for AuthnError instances. This allows common definitions for authentication errors to be shared across plugins. Once created, objects of this class are immutable. Objects of this class are not normally returned in API responses. Instead, you create an AuthnError instance using the makeInstance() or makeInstanceBuilder() methods.
    Since:
    9.3
    • Constructor Detail

      • AuthnErrorSpec

        public AuthnErrorSpec​(int httpStatus,
                              String code,
                              String message)
        Create a spec with the specified parameters.
        Parameters:
        httpStatus - The HTTP status code for the error.
        code - The error code.
        message - The error message.
    • Method Detail

      • makeInstanceBuilder

        public AuthnError.Builder makeInstanceBuilder()
        Get an AuthnError builder initialized with the parameters from this spec.
      • makeInstance

        public AuthnError makeInstance()
        Get an instance of AuthnError based on the parameters in this spec.
      • getHttpStatus

        public int getHttpStatus()
        Get the HTTP status for this error.
      • getCode

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

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

        public String getUserMessageKey()
        Get the user-facing error message key. A message key should be provided for any error likely to be displayed to the end user, with a corresponding error message specified in authn-api-messages.properties.