Interface AuthErrorResponse

All Superinterfaces:
ErrorResponse

public interface AuthErrorResponse extends ErrorResponse

Represents errors related to authentication and authorization in a format conforming to the OAuth 2.0 specification.


Example to create an instance using the builder pattern

     AuthErrorResponse authErrorResponse = AuthErrorResponse.builder()
             .statusCode(1)
             .message("{message}")
             .plusErrors(errorsBuilder -> errorsBuilder)
             .error("{error}")
             .build()
 
  • Method Details

    • getError

      @NotNull @NotNull String getError()

      Error code as per the OAuth 2.0 specification. For example: "access_denied".

      Returns:
      error
    • getErrorDescription

      String getErrorDescription()

      Plain text description of the first error.

      Returns:
      error_description
    • getErrors

      @NotNull @Valid @NotNull @Valid List<ErrorObject> getErrors()

      Authentication and authorization-related errors returned for a request.

      Specified by:
      getErrors in interface ErrorResponse
      Returns:
      errors
    • setError

      void setError(String error)

      Error code as per the OAuth 2.0 specification. For example: "access_denied".

      Parameters:
      error - value to be set
    • setErrorDescription

      void setErrorDescription(String errorDescription)

      Plain text description of the first error.

      Parameters:
      errorDescription - value to be set
    • setErrors

      void setErrors(ErrorObject... errors)

      Authentication and authorization-related errors returned for a request.

      Specified by:
      setErrors in interface ErrorResponse
      Parameters:
      errors - values to be set
    • setErrors

      void setErrors(List<ErrorObject> errors)

      Authentication and authorization-related errors returned for a request.

      Specified by:
      setErrors in interface ErrorResponse
      Parameters:
      errors - values to be set
    • of

      static AuthErrorResponse of()
      factory method
      Returns:
      instance of AuthErrorResponse
    • of

      static AuthErrorResponse of(AuthErrorResponse template)
      factory method to create a shallow copy AuthErrorResponse
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of AuthErrorResponse
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static AuthErrorResponseBuilder builder()
      builder factory method for AuthErrorResponse
      Returns:
      builder
    • builder

      static AuthErrorResponseBuilder builder(AuthErrorResponse template)
      create builder for AuthErrorResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withAuthErrorResponse

      default <T> T withAuthErrorResponse(Function<AuthErrorResponse,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<AuthErrorResponse> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference