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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSession(QInstance qInstance, Map<String, String> context) Create or restore a session.booleanisSessionValid(QInstance instance, QSession session) static voidpersistSession(QSession session) Persist session data to StateProvider.booleanIndicates that this module uses session ID cookies for session management.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.kingsrook.qqq.backend.core.modules.authentication.QAuthenticationModuleInterface
createAutomatedSessionForUser, getLoginRedirectUrl
-
Field Details
-
TEST_ACCESS_TOKEN
- See Also:
-
SESSION_UUID_KEY
- See Also:
-
-
Constructor Details
-
FullyAnonymousAuthenticationModule
public FullyAnonymousAuthenticationModule()
-
-
Method Details
-
persistSession
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
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:
createSessionin interfaceQAuthenticationModuleInterface- Parameters:
qInstance- The QInstancecontext- The authentication context (may contain sessionUUID)- Returns:
- The created or restored session
-
isSessionValid
- Specified by:
isSessionValidin interfaceQAuthenticationModuleInterface
-
usesSessionIdCookie
public boolean usesSessionIdCookie()Indicates that this module uses session ID cookies for session management.- Specified by:
usesSessionIdCookiein interfaceQAuthenticationModuleInterface- Returns:
- true to enable session cookie management
-