Package org.keycloak.services.managers
Class AuthenticationSessionManager
- java.lang.Object
-
- org.keycloak.services.managers.AuthenticationSessionManager
-
public class AuthenticationSessionManager extends Object
- Author:
- Marek Posolda
-
-
Field Summary
Fields Modifier and Type Field Description static int
AUTH_SESSION_COOKIE_LIMIT
static String
AUTH_SESSION_ID
-
Constructor Summary
Constructors Constructor Description AuthenticationSessionManager(org.keycloak.models.KeycloakSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.keycloak.sessions.RootAuthenticationSessionModel
createAuthenticationSession(org.keycloak.models.RealmModel realm, boolean browserCookie)
Creates a fresh authentication session for the given realm .org.keycloak.sessions.AuthenticationSessionModel
getAuthenticationSessionByIdAndClient(org.keycloak.models.RealmModel realm, String authSessionId, org.keycloak.models.ClientModel client, String tabId)
org.keycloak.sessions.AuthenticationSessionModel
getCurrentAuthenticationSession(org.keycloak.models.RealmModel realm, org.keycloak.models.ClientModel client, String tabId)
Returns current authentication session if it exists, otherwise returnsnull
.org.keycloak.sessions.RootAuthenticationSessionModel
getCurrentRootAuthenticationSession(org.keycloak.models.RealmModel realm)
org.keycloak.models.UserSessionModel
getUserSession(org.keycloak.sessions.AuthenticationSessionModel authSession)
org.keycloak.models.UserSessionModel
getUserSessionFromAuthCookie(org.keycloak.models.RealmModel realm)
void
removeAuthenticationSession(org.keycloak.models.RealmModel realm, org.keycloak.sessions.AuthenticationSessionModel authSession, boolean expireRestartCookie)
void
setAuthSessionCookie(String authSessionId, org.keycloak.models.RealmModel realm)
-
-
-
Field Detail
-
AUTH_SESSION_ID
public static final String AUTH_SESSION_ID
- See Also:
- Constant Field Values
-
AUTH_SESSION_COOKIE_LIMIT
public static final int AUTH_SESSION_COOKIE_LIMIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
createAuthenticationSession
public org.keycloak.sessions.RootAuthenticationSessionModel createAuthenticationSession(org.keycloak.models.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
public org.keycloak.sessions.RootAuthenticationSessionModel getCurrentRootAuthenticationSession(org.keycloak.models.RealmModel realm)
-
getUserSessionFromAuthCookie
public org.keycloak.models.UserSessionModel getUserSessionFromAuthCookie(org.keycloak.models.RealmModel realm)
-
getCurrentAuthenticationSession
public org.keycloak.sessions.AuthenticationSessionModel getCurrentAuthenticationSession(org.keycloak.models.RealmModel realm, org.keycloak.models.ClientModel client, String tabId)
Returns current authentication session if it exists, otherwise returnsnull
.- Parameters:
realm
-- Returns:
-
setAuthSessionCookie
public void setAuthSessionCookie(String authSessionId, org.keycloak.models.RealmModel realm)
- Parameters:
authSessionId
- decoded authSessionId (without route info attached)realm
-
-
removeAuthenticationSession
public void removeAuthenticationSession(org.keycloak.models.RealmModel realm, org.keycloak.sessions.AuthenticationSessionModel authSession, boolean expireRestartCookie)
-
getUserSession
public org.keycloak.models.UserSessionModel getUserSession(org.keycloak.sessions.AuthenticationSessionModel authSession)
-
-