Class IdentityExceptionHandler

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=IdentitiesApi.class) public class IdentityExceptionHandler extends SignInMethodExceptionHandler
Answers the failures of the identities API as application/problem+json. The last-sign-in-method and step-up answers are the shared ones of SignInMethodExceptionHandler.
  • 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 an identity the account does not have (another account's identity 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

    • IdentityExceptionHandler

      public IdentityExceptionHandler(MfaExceptionHandler mfaExceptionHandler)
      Creates the handler.
      Parameters:
      mfaExceptionHandler - builds the step-up challenge.
  • Method Details

    • handleNotFound

      @ExceptionHandler(FederatedIdentityNotFoundException.class) public org.springframework.http.ResponseEntity<org.springframework.http.ProblemDetail> handleNotFound(FederatedIdentityNotFoundException exception)
      Answers an identity the account does not have (another account's identity is answered the same way).
      Parameters:
      exception - the failure.
      Returns:
      the 404 problem detail.