Package com.mindstore.backend.controller
Class CustomOAuth2SuccessHandler
java.lang.Object
com.mindstore.backend.controller.CustomOAuth2SuccessHandler
- All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler
public class CustomOAuth2SuccessHandler
extends Object
implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
Custom Handler for Success Page when using OAuth - Google Authentication
-
Constructor Summary
ConstructorsConstructorDescriptionCustomOAuth2SuccessHandler(JwtService jwtService, AuthenticationService authService) custom success handler class -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) Methods 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
-
CustomOAuth2SuccessHandler
custom success handler class- Parameters:
jwtService- for authenticating jwt tokenauthService- service class for authentication actions
-
-
Method Details
-
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException - Specified by:
onAuthenticationSuccessin interfaceorg.springframework.security.web.authentication.AuthenticationSuccessHandler- Parameters:
request- - the request that was maderesponse- - the extended responseauthentication- of the user- Throws:
IOException- for sendRedirect function: this controller is used to redirect the user after a oAuth login it redirects back to /
-