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
FieldsFields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleAlreadyExists(ClientAlreadyExistsException exception) Answers a duplicated client identifier.org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleInvalid(IllegalArgumentException exception) Answers an invalid client definition or a secret operation that does not apply.org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleInvalidJwks(InvalidClientJwksException exception) Answers a JWK set that is invalid or holds a private key.org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleNotFound(ClientNotFoundException exception) Answers an unknown client.private static org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> Builds a problem response.Methods inherited from class com.irurueta.authserver.authorization.api.web.ProblemJsonExceptionHandler
createResponseEntity, problemResponse, problemResponseMethods 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
-
Field Details
-
TYPE_BASE
Base of the problem type URNs.- See Also:
-
-
Constructor Details
-
ClientExceptionHandler
public ClientExceptionHandler()
-
-
Method Details
-
handleNotFound
@ExceptionHandler(com.irurueta.authserver.authorization.domain.clients.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(com.irurueta.authserver.authorization.domain.clients.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.
-