Class CertificateExceptionHandler

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
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

    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
    Creates the handler.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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>
    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, respond

    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

    • CertificateExceptionHandler

      public CertificateExceptionHandler(MfaExceptionHandler mfaExceptionHandler)
      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 400 problem 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 409 problem 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 404 problem detail.