Package org.keycloak.services.managers
Class AuthenticationSessionManager
java.lang.Object
org.keycloak.services.managers.AuthenticationSessionManager
- Author:
- Marek Posolda
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAuthenticationSession
(RealmModel realm, boolean browserCookie) Creates a fresh authentication session for the given realm .getAuthenticationSessionByIdAndClient
(RealmModel realm, String authSessionId, ClientModel client, String tabId) getCurrentAuthenticationSession
(RealmModel realm, ClientModel client, String tabId) Returns current authentication session if it exists, otherwise returnsnull
.getUserSession
(AuthenticationSessionModel authSession) void
removeAuthenticationSession
(RealmModel realm, AuthenticationSessionModel authSession, boolean expireRestartCookie) void
removeTabIdInAuthenticationSession
(RealmModel realm, AuthenticationSessionModel authSession) void
setAuthSessionCookie
(String authSessionId, RealmModel realm)
-
Field Details
-
AUTH_SESSION_ID
- See Also:
-
AUTH_SESSION_COOKIE_LIMIT
public static final int AUTH_SESSION_COOKIE_LIMIT- See Also:
-
-
Constructor Details
-
AuthenticationSessionManager
-
-
Method Details
-
createAuthenticationSession
public RootAuthenticationSessionModel createAuthenticationSession(RealmModel realm, boolean browserCookie) Creates a fresh authentication session for the given realm . Optionally sets the browser authentication session cookieAUTH_SESSION_ID
with the ID of the new session.- Parameters:
realm
-browserCookie
- Set the cookie in the browser for the- Returns:
-
getCurrentRootAuthenticationSession
-
getUserSessionFromAuthCookie
-
getCurrentAuthenticationSession
public AuthenticationSessionModel getCurrentAuthenticationSession(RealmModel realm, ClientModel client, String tabId) Returns current authentication session if it exists, otherwise returnsnull
.- Parameters:
realm
-- Returns:
-
setAuthSessionCookie
- Parameters:
authSessionId
- decoded authSessionId (without route info attached)realm
-
-
removeAuthenticationSession
public void removeAuthenticationSession(RealmModel realm, AuthenticationSessionModel authSession, boolean expireRestartCookie) -
removeTabIdInAuthenticationSession
public void removeTabIdInAuthenticationSession(RealmModel realm, AuthenticationSessionModel authSession) -
getUserSession
-
getAuthenticationSessionByIdAndClient
public AuthenticationSessionModel getAuthenticationSessionByIdAndClient(RealmModel realm, String authSessionId, ClientModel client, String tabId)
-