Class OAuth2ErrorAuthenticationFailureHandler

java.lang.Object
org.springframework.security.oauth2.server.authorization.web.authentication.OAuth2ErrorAuthenticationFailureHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationFailureHandler

public final class OAuth2ErrorAuthenticationFailureHandler extends Object implements org.springframework.security.web.authentication.AuthenticationFailureHandler
An implementation of an AuthenticationFailureHandler used for handling an OAuth2AuthenticationException and returning the OAuth 2.0 Error Response.
Since:
1.2
See Also:
  • AuthenticationFailureHandler
  • OAuth2ErrorHttpMessageConverter
  • Constructor Details

    • OAuth2ErrorAuthenticationFailureHandler

      public OAuth2ErrorAuthenticationFailureHandler()
  • Method Details

    • onAuthenticationFailure

      public void onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authenticationException) throws IOException, jakarta.servlet.ServletException
      Specified by:
      onAuthenticationFailure in interface org.springframework.security.web.authentication.AuthenticationFailureHandler
      Throws:
      IOException
      jakarta.servlet.ServletException
    • setErrorResponseConverter

      public void setErrorResponseConverter(org.springframework.http.converter.HttpMessageConverter<org.springframework.security.oauth2.core.OAuth2Error> errorResponseConverter)
      Sets the HttpMessageConverter used for converting an OAuth2Error to an HTTP response.
      Parameters:
      errorResponseConverter - the HttpMessageConverter used for converting an OAuth2Error to an HTTP response