Class AuthnErrorDetailSpec


  • public class AuthnErrorDetailSpec
    extends Object
    A class which acts as a template for AuthnErrorDetail instances. This allows common definitions for authentication error details 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 AuthnErrorDetail instance using the makeInstance() or makeInstanceBuilder() methods.
    Since:
    9.3
    • Constructor Detail

      • AuthnErrorDetailSpec

        public AuthnErrorDetailSpec​(String parentCode,
                                    String code,
                                    String message)
        Create a spec with the specified parameters.
        Parameters:
        parentCode - The parent error code this detail spec belongs to.
        code - The error code.
        message - The error message.
    • Method Detail

      • getParentCode

        public String getParentCode()
        Get the parent error code. This is the top-level error code that this detail spec is associated with.
      • 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.
      • getTarget

        public String getTarget()
        If the error applies to a specific field in an incoming API request, this identifies the name of the JSON field. If the field is nested within the incoming request, JSON pointer syntax is used to identify the field. The leading "/" is omitted when JSON pointer syntax is used.