Package cronapp.framework.security
Class JwtAuthenticationSuccessHandler
java.lang.Object
cronapp.framework.security.JwtAuthenticationSuccessHandler
- All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler
@Component
@ConditionalOnProperty(prefix="cronapp.security.token",
name="enabled",
havingValue="true")
public class JwtAuthenticationSuccessHandler
extends Object
implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
Custom authentication success handler that generates a JWT token and sends it as a JSON response.
-
Constructor Summary
Constructors -
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
-
JwtAuthenticationSuccessHandler
public JwtAuthenticationSuccessHandler()
-
-
Method Details
-
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws jakarta.servlet.ServletException, IOException - Specified by:
onAuthenticationSuccessin interfaceorg.springframework.security.web.authentication.AuthenticationSuccessHandler- Throws:
jakarta.servlet.ServletExceptionIOException
-