Class CertificateExceptionHandler
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
com.irurueta.authserver.authorization.api.web.ProblemJsonExceptionHandler
com.irurueta.authserver.authorization.api.web.social.SignInMethodExceptionHandler
com.irurueta.authserver.authorization.api.web.x509.CertificateExceptionHandler
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.MessageSourceAware
@RestControllerAdvice(assignableTypes=CertificatesApi.class)
public class CertificateExceptionHandler
extends SignInMethodExceptionHandler
Answers the failures of the certificates API as
application/problem+json. The last-sign-in-method and step-up
answers are the shared ones of SignInMethodExceptionHandler, so a client handles them as for the identities.-
Field Summary
FieldsFields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger -
Constructor Summary
ConstructorsConstructorDescriptionCertificateExceptionHandler(MfaExceptionHandler mfaExceptionHandler) Creates the handler. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> Answers a certificate that is bound to another account.org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> Answers a value that is not a usable certificate.org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleNotFound(CertificateNotFoundException exception) Answers a certificate the account does not have (another account's certificate is answered the same way).Methods inherited from class com.irurueta.authserver.authorization.api.web.social.SignInMethodExceptionHandler
handleInsufficientUserAuthentication, handleLastSignInMethod, respondMethods 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
-
CertificateExceptionHandler
Creates the handler.- Parameters:
mfaExceptionHandler- builds the step-up challenge.
-
-
Method Details
-
handleInvalidCertificate
@ExceptionHandler(InvalidCertificateException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleInvalidCertificate(InvalidCertificateException exception) Answers a value that is not a usable certificate.- Parameters:
exception- the failure.- Returns:
- the
400problem detail.
-
handleAlreadyBound
@ExceptionHandler(CertificateAlreadyBoundException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleAlreadyBound(CertificateAlreadyBoundException exception) Answers a certificate that is bound to another account.- Parameters:
exception- the failure.- Returns:
- the
409problem detail.
-
handleNotFound
@ExceptionHandler(CertificateNotFoundException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleNotFound(CertificateNotFoundException exception) Answers a certificate the account does not have (another account's certificate is answered the same way).- Parameters:
exception- the failure.- Returns:
- the
404problem detail.
-