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
  • Constructor Details

    • OAuth2FormLoginAuthenticationFailureHandler

      public OAuth2FormLoginAuthenticationFailureHandler()
    • OAuth2FormLoginAuthenticationFailureHandler

      public OAuth2FormLoginAuthenticationFailureHandler(String defaultFailureUrl)
  • 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:
      onAuthenticationFailure in interface org.springframework.security.web.authentication.AuthenticationFailureHandler
      Overrides:
      onAuthenticationFailure in class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
      Throws:
      IOException
      jakarta.servlet.ServletException
    • saveException

      protected final void saveException(jakarta.servlet.http.HttpServletRequest request, String message)
    • setDefaultFailureUrl

      public void setDefaultFailureUrl(String defaultFailureUrl)
      The URL which will be used as the failure destination.
      Overrides:
      setDefaultFailureUrl in class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
      Parameters:
      defaultFailureUrl - the failure URL, for example "/loginFailed.jsp".
    • isUseForward

      protected boolean isUseForward()
      Overrides:
      isUseForward in class org.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:
      setUseForward in class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
    • getRedirectStrategy

      protected org.springframework.security.web.RedirectStrategy getRedirectStrategy()
      Overrides:
      getRedirectStrategy in class org.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:
      setRedirectStrategy in class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
    • isAllowSessionCreation

      protected boolean isAllowSessionCreation()
      Overrides:
      isAllowSessionCreation in class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
    • setAllowSessionCreation

      public void setAllowSessionCreation(boolean allowSessionCreation)
      Overrides:
      setAllowSessionCreation in class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler