Class PasskeyAuthSuccessHandler

java.lang.Object
org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
sk.iway.iwcm.system.spring.passkey.PasskeyAuthSuccessHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler

public class PasskeyAuthSuccessHandler extends org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
Success handler for WebAuthn/PassKey authentication. After successful passkey verification, establishes the WebJET session (Identity) and Spring Security context, then redirects to admin. Follows the same pattern as OAuth2AdminSuccessHandler: 1. Gets username from the WebAuthn authentication principal 2. Finds the user in the WebJET database 3. Creates Identity and sets it to the session 4. Creates Spring Security authentication token 5. Redirects to /admin/v9/
  • Field Summary

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

    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)
     

    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

    • PasskeyAuthSuccessHandler

      public PasskeyAuthSuccessHandler()
  • 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
      Specified by:
      onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
      Overrides:
      onAuthenticationSuccess in class org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
      Throws:
      IOException
      jakarta.servlet.ServletException