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:
-
AuthenticationFailureHandlerOAuth2ErrorHttpMessageConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authenticationException) voidsetErrorResponseConverter(org.springframework.http.converter.HttpMessageConverter<org.springframework.security.oauth2.core.OAuth2Error> errorResponseConverter) Sets theHttpMessageConverterused for converting anOAuth2Errorto an HTTP response.
-
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:
onAuthenticationFailurein interfaceorg.springframework.security.web.authentication.AuthenticationFailureHandler- Throws:
IOExceptionjakarta.servlet.ServletException
-
setErrorResponseConverter
public void setErrorResponseConverter(org.springframework.http.converter.HttpMessageConverter<org.springframework.security.oauth2.core.OAuth2Error> errorResponseConverter) Sets theHttpMessageConverterused for converting anOAuth2Errorto an HTTP response.- Parameters:
errorResponseConverter- theHttpMessageConverterused for converting anOAuth2Errorto an HTTP response
-