Class ExternalProviderAuthenticationSuccessHandler

java.lang.Object
org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
app.services.config.ExternalProviderAuthenticationSuccessHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler

@Component public class ExternalProviderAuthenticationSuccessHandler extends org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
  • Field Summary

    Fields inherited from class org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
    This method is called when the user successfully authenticates with an external provider.

    Methods inherited from class org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler

    setRequestCache

    Methods inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler

    clearAuthenticationAttributes

    Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler

    determineTargetUrl, determineTargetUrl, getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, handle, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseReferer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler

    onAuthenticationSuccess
  • Constructor Details

    • ExternalProviderAuthenticationSuccessHandler

      public ExternalProviderAuthenticationSuccessHandler()
  • Method Details

    • onAuthenticationSuccess

      public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException, jakarta.servlet.ServletException
      This method is called when the user successfully authenticates with an external provider. It retrieves the ExternalProviderUser from the authentication object, creates a new user in the system, and sets the default target URL to "/event/all".
      Specified by:
      onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
      Overrides:
      onAuthenticationSuccess in class org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
      Parameters:
      request - The HttpServletRequest object representing the incoming request.
      response - The HttpServletResponse object representing the response to be sent.
      authentication - The Authentication object representing the authenticated user.
      Throws:
      IOException - If an input or output error occurs.
      jakarta.servlet.ServletException - If a servlet-specific error occurs.