Class OAuth2FormLoginAuthenticationFailureHandler
java.lang.Object
org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
cn.herodotus.engine.oauth2.authentication.response.OAuth2FormLoginAuthenticationFailureHandler
- All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationFailureHandler
public class OAuth2FormLoginAuthenticationFailureHandler
extends org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
Description : 表单登录失败处理器
- Author:
- : gengwei.zheng
- See Also:
-
SimpleUrlAuthenticationFailureHandler
- Date:
- : 2020/1/26 18:08
-
Field Summary
Fields inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.security.web.RedirectStrategyprotected booleanprotected booleanvoidonAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException e) protected final voidsaveException(jakarta.servlet.http.HttpServletRequest request, String message) voidsetAllowSessionCreation(boolean allowSessionCreation) voidsetDefaultFailureUrl(String defaultFailureUrl) The URL which will be used as the failure destination.voidsetRedirectStrategy(org.springframework.security.web.RedirectStrategy redirectStrategy) Allows overriding of the behaviour when redirecting to a target URL.voidsetUseForward(boolean forwardToDestination) If set to true, performs a forward to the failure destination URL instead of a redirect.Methods inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
saveException
-
Constructor Details
-
OAuth2FormLoginAuthenticationFailureHandler
public OAuth2FormLoginAuthenticationFailureHandler() -
OAuth2FormLoginAuthenticationFailureHandler
-
-
Method Details
-
onAuthenticationFailure
public void onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException e) throws IOException, jakarta.servlet.ServletException - Specified by:
onAuthenticationFailurein interfaceorg.springframework.security.web.authentication.AuthenticationFailureHandler- Overrides:
onAuthenticationFailurein classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler- Throws:
IOExceptionjakarta.servlet.ServletException
-
saveException
-
setDefaultFailureUrl
The URL which will be used as the failure destination.- Overrides:
setDefaultFailureUrlin classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler- Parameters:
defaultFailureUrl- the failure URL, for example "/loginFailed.jsp".
-
isUseForward
protected boolean isUseForward()- Overrides:
isUseForwardin classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
-
setUseForward
public void setUseForward(boolean forwardToDestination) If set to true, performs a forward to the failure destination URL instead of a redirect. Defaults to false.- Overrides:
setUseForwardin classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
-
getRedirectStrategy
protected org.springframework.security.web.RedirectStrategy getRedirectStrategy()- Overrides:
getRedirectStrategyin classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
-
setRedirectStrategy
public void setRedirectStrategy(org.springframework.security.web.RedirectStrategy redirectStrategy) Allows overriding of the behaviour when redirecting to a target URL.- Overrides:
setRedirectStrategyin classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
-
isAllowSessionCreation
protected boolean isAllowSessionCreation()- Overrides:
isAllowSessionCreationin classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
-
setAllowSessionCreation
public void setAllowSessionCreation(boolean allowSessionCreation) - Overrides:
setAllowSessionCreationin classorg.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
-