public class AuthenticationSessionManager extends Object
Modifier and Type | Field and Description |
---|---|
static int |
AUTH_SESSION_COOKIE_LIMIT |
static String |
AUTH_SESSION_ID |
Constructor and Description |
---|
AuthenticationSessionManager(KeycloakSession session) |
Modifier and Type | Method and Description |
---|---|
RootAuthenticationSessionModel |
createAuthenticationSession(RealmModel realm,
boolean browserCookie)
Creates a fresh authentication session for the given realm .
|
AuthenticationSessionModel |
getAuthenticationSessionByIdAndClient(RealmModel realm,
String authSessionId,
ClientModel client,
String tabId) |
AuthenticationSessionModel |
getCurrentAuthenticationSession(RealmModel realm,
ClientModel client,
String tabId)
Returns current authentication session if it exists, otherwise returns
null . |
RootAuthenticationSessionModel |
getCurrentRootAuthenticationSession(RealmModel realm) |
UserSessionModel |
getUserSession(AuthenticationSessionModel authSession) |
UserSessionModel |
getUserSessionFromAuthCookie(RealmModel realm) |
void |
removeAuthenticationSession(RealmModel realm,
AuthenticationSessionModel authSession,
boolean expireRestartCookie) |
void |
setAuthSessionCookie(String authSessionId,
RealmModel realm) |
public static final String AUTH_SESSION_ID
public static final int AUTH_SESSION_COOKIE_LIMIT
public AuthenticationSessionManager(KeycloakSession session)
public RootAuthenticationSessionModel createAuthenticationSession(RealmModel realm, boolean browserCookie)
AUTH_SESSION_ID
with the ID of the new session.realm
- browserCookie
- Set the cookie in the browser for thepublic RootAuthenticationSessionModel getCurrentRootAuthenticationSession(RealmModel realm)
public UserSessionModel getUserSessionFromAuthCookie(RealmModel realm)
public AuthenticationSessionModel getCurrentAuthenticationSession(RealmModel realm, ClientModel client, String tabId)
null
.realm
- public void setAuthSessionCookie(String authSessionId, RealmModel realm)
authSessionId
- decoded authSessionId (without route info attached)realm
- public void removeAuthenticationSession(RealmModel realm, AuthenticationSessionModel authSession, boolean expireRestartCookie)
public UserSessionModel getUserSession(AuthenticationSessionModel authSession)
public AuthenticationSessionModel getAuthenticationSessionByIdAndClient(RealmModel realm, String authSessionId, ClientModel client, String tabId)
Copyright © 2021 JBoss by Red Hat. All rights reserved.