Package app.services.config
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationSuccess(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
setRequestCacheMethods inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
clearAuthenticationAttributesMethods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
determineTargetUrl, determineTargetUrl, getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, handle, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseRefererMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 theExternalProviderUserfrom the authentication object, creates a new user in the system, and sets the default target URL to "/event/all".- Specified by:
onAuthenticationSuccessin interfaceorg.springframework.security.web.authentication.AuthenticationSuccessHandler- Overrides:
onAuthenticationSuccessin classorg.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler- Parameters:
request- TheHttpServletRequestobject representing the incoming request.response- TheHttpServletResponseobject representing the response to be sent.authentication- TheAuthenticationobject representing the authenticated user.- Throws:
IOException- If an input or output error occurs.jakarta.servlet.ServletException- If a servlet-specific error occurs.
-