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
    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)
     

    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

    • 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:
      onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
      Throws:
      jakarta.servlet.ServletException
      IOException