Class AuthenticationExceptionMapper

  • All Implemented Interfaces:
    javax.ws.rs.ext.ExceptionMapper<org.springframework.security.core.AuthenticationException>

    @Provider
    @Component
    public class AuthenticationExceptionMapper
    extends AbstractExceptionMapper<org.springframework.security.core.AuthenticationException>
    Handles Spring Security AuthenticationException by producing a 403 Forbidden response.
    • Constructor Detail

      • AuthenticationExceptionMapper

        @Autowired
        public AuthenticationExceptionMapper​(io.swagger.v3.oas.models.OpenAPI spec,
                                             BuildInfo buildInfo)
    • Method Detail

      • getStatus

        protected javax.ws.rs.core.Response.Status getStatus​(org.springframework.security.core.AuthenticationException exception)
        Description copied from class: AbstractExceptionMapper
        Translate the exception to an HTTP Response.Status.
        Specified by:
        getStatus in class AbstractExceptionMapper<org.springframework.security.core.AuthenticationException>
      • logException

        protected boolean logException​(org.springframework.security.core.AuthenticationException e)
        Description copied from class: AbstractExceptionMapper
        Indicate if the given exception should be logged.
        Overrides:
        logException in class AbstractExceptionMapper<org.springframework.security.core.AuthenticationException>