Class FullyAnonymousAuthenticationModule

java.lang.Object
com.kingsrook.qqq.backend.core.modules.authentication.implementations.FullyAnonymousAuthenticationModule
All Implemented Interfaces:
QAuthenticationModuleInterface

public class FullyAnonymousAuthenticationModule extends Object implements QAuthenticationModuleInterface
An authentication module with no actual backing system - all users are treated as anonymous, and all sessions are always valid.

Sessions are persisted using StateProvider, allowing session values to be stored and retrieved across requests. The session UUID is stored in a cookie and used to restore session data.

  • Field Details

  • Constructor Details

    • FullyAnonymousAuthenticationModule

      public FullyAnonymousAuthenticationModule()
  • Method Details

    • persistSession

      public static void persistSession(QSession session)
      Persist session data to StateProvider.

      This should be called after modifying session values to ensure they persist across requests.

      Parameters:
      session - The session to persist
    • createSession

      public QSession createSession(QInstance qInstance, Map<String,String> context)
      Create or restore a session.

      If a session UUID is provided in the context, attempts to restore the session from StateProvider. Otherwise, creates a new session.

      Specified by:
      createSession in interface QAuthenticationModuleInterface
      Parameters:
      qInstance - The QInstance
      context - The authentication context (may contain sessionUUID)
      Returns:
      The created or restored session
    • isSessionValid

      public boolean isSessionValid(QInstance instance, QSession session)
      Specified by:
      isSessionValid in interface QAuthenticationModuleInterface
    • usesSessionIdCookie

      public boolean usesSessionIdCookie()
      Indicates that this module uses session ID cookies for session management.
      Specified by:
      usesSessionIdCookie in interface QAuthenticationModuleInterface
      Returns:
      true to enable session cookie management