Class ClientExceptionHandler

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
com.irurueta.authserver.authorization.api.web.ProblemJsonExceptionHandler
com.irurueta.authserver.authorization.api.web.clients.ClientExceptionHandler
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.MessageSourceAware

@RestControllerAdvice(assignableTypes=ClientAdminController.class) public class ClientExceptionHandler extends ProblemJsonExceptionHandler
Translates the failures of ClientAdminController to RFC 9457 problem details, answered as application/problem+json. Request validation failures are handled by the parent class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Base of the problem type URNs.

    Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail>
    Answers a duplicated client identifier.
    org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail>
    Answers an invalid client definition or a secret operation that does not apply.
    org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail>
    Answers a JWK set that is invalid or holds a private key.
    org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail>
    Answers an unknown client.
    private static org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail>
    respond(org.springframework.http.HttpStatus status, String type, String title, String detail)
    Builds a problem response.

    Methods inherited from class com.irurueta.authserver.authorization.api.web.ProblemJsonExceptionHandler

    createResponseEntity, problemResponse, problemResponse

    Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    createProblemDetail, getMessageSource, handleAsyncRequestNotUsableException, handleAsyncRequestTimeoutException, handleConversionNotSupported, handleErrorResponseException, handleException, handleExceptionInternal, handleHandlerMethodValidationException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMaxUploadSizeExceededException, handleMethodArgumentNotValid, handleMethodValidationException, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleNoResourceFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ClientExceptionHandler

      public ClientExceptionHandler()
  • Method Details

    • handleNotFound

      @ExceptionHandler(ClientNotFoundException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleNotFound(ClientNotFoundException exception)
      Answers an unknown client.
      Parameters:
      exception - the failure.
      Returns:
      the problem detail.
    • handleAlreadyExists

      @ExceptionHandler(ClientAlreadyExistsException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleAlreadyExists(ClientAlreadyExistsException exception)
      Answers a duplicated client identifier.
      Parameters:
      exception - the failure.
      Returns:
      the problem detail.
    • handleInvalidJwks

      @ExceptionHandler(InvalidClientJwksException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleInvalidJwks(InvalidClientJwksException exception)
      Answers a JWK set that is invalid or holds a private key.
      Parameters:
      exception - the failure.
      Returns:
      the problem detail.
    • handleInvalid

      @ExceptionHandler(java.lang.IllegalArgumentException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleInvalid(IllegalArgumentException exception)
      Answers an invalid client definition or a secret operation that does not apply.
      Parameters:
      exception - the failure.
      Returns:
      the problem detail.
    • respond

      private static org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> respond(org.springframework.http.HttpStatus status, String type, String title, String detail)
      Builds a problem response.
      Parameters:
      status - HTTP status.
      type - last segment of the problem type.
      title - short summary.
      detail - explanation.
      Returns:
      the response.