Package org.keycloak.sessions
Interface AuthenticationSessionProvider
-
- All Superinterfaces:
Provider
public interface AuthenticationSessionProvider extends Provider
- Author:
- Marek Posolda
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default RootAuthenticationSessionModelcreateRootAuthenticationSession(String id, RealmModel realm)Deprecated.UsecreateRootAuthenticationSession(RealmModel, String)createRootAuthenticationSession} instead.RootAuthenticationSessionModelcreateRootAuthenticationSession(RealmModel realm)Creates and registers a new authentication session with random ID.RootAuthenticationSessionModelcreateRootAuthenticationSession(RealmModel realm, String id)Creates a new root authentication session specified by the provided realm and id.RootAuthenticationSessionModelgetRootAuthenticationSession(RealmModel realm, String authenticationSessionId)Returns the root authentication session specified by the provided realm and id.voidonClientRemoved(RealmModel realm, ClientModel client)Removes all associated root authentication sessions to the given realm and client which was removed.voidonRealmRemoved(RealmModel realm)Removes all associated root authentication sessions to the given realm which was removed.voidremoveAllExpired()Remove expired authentication sessions in all the realmsvoidremoveExpired(RealmModel realm)Removes all expired root authentication sessions for the given realm.voidremoveRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession)Removes provided root authentication session.voidupdateNonlocalSessionAuthNotes(AuthenticationSessionCompoundId compoundId, Map<String,String> authNotesFragment)Requests update of authNotes of a root authentication session that is not owned by this instance but might exist somewhere in the cluster.
-
-
-
Method Detail
-
createRootAuthenticationSession
RootAuthenticationSessionModel createRootAuthenticationSession(RealmModel realm)
Creates and registers a new authentication session with random ID. Authentication session entity will be prefilled with current timestamp, the given realm and client.- Parameters:
realm-RealmModelCan't benull.- Returns:
- Returns created
RootAuthenticationSessionModel. Never returnsnull.
-
createRootAuthenticationSession
@Deprecated default RootAuthenticationSessionModel createRootAuthenticationSession(String id, RealmModel realm)
Deprecated.UsecreateRootAuthenticationSession(RealmModel, String)createRootAuthenticationSession} instead.Creates a new root authentication session specified by the provided id and realm.- Parameters:
id-StringId of newly created root authentication session. Ifnulla random id will be generated.realm-RealmModelCan't benull.- Returns:
- Returns created
RootAuthenticationSessionModel. Never returnsnull.
-
createRootAuthenticationSession
RootAuthenticationSessionModel createRootAuthenticationSession(RealmModel realm, String id)
Creates a new root authentication session specified by the provided realm and id.- Parameters:
realm-RealmModelCan't benull.id-StringId of newly created root authentication session. Ifnulla random id will be generated.- Returns:
- Returns created
RootAuthenticationSessionModel. Never returnsnull.
-
getRootAuthenticationSession
RootAuthenticationSessionModel getRootAuthenticationSession(RealmModel realm, String authenticationSessionId)
Returns the root authentication session specified by the provided realm and id.- Parameters:
realm-RealmModelCan't benull.authenticationSessionId-RootAuthenticationSessionModelIfnullthennullwill be returned.- Returns:
- Returns found
RootAuthenticationSessionModelornullif no root authentication session is found.
-
removeRootAuthenticationSession
void removeRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession)
Removes provided root authentication session.- Parameters:
realm-RealmModelAssociated realm to the given root authentication session.authenticationSession-RootAuthenticationSessionModelCan't benull.
-
removeAllExpired
void removeAllExpired()
Remove expired authentication sessions in all the realms
-
removeExpired
void removeExpired(RealmModel realm)
Removes all expired root authentication sessions for the given realm.- Parameters:
realm-RealmModelCan't benull.
-
onRealmRemoved
void onRealmRemoved(RealmModel realm)
Removes all associated root authentication sessions to the given realm which was removed.- Parameters:
realm-RealmModelCan't benull.
-
onClientRemoved
void onClientRemoved(RealmModel realm, ClientModel client)
Removes all associated root authentication sessions to the given realm and client which was removed.- Parameters:
realm-RealmModelCan't benull.client-ClientModelCan't benull.
-
updateNonlocalSessionAuthNotes
void updateNonlocalSessionAuthNotes(AuthenticationSessionCompoundId compoundId, Map<String,String> authNotesFragment)
Requests update of authNotes of a root authentication session that is not owned by this instance but might exist somewhere in the cluster.- Parameters:
compoundId-AuthenticationSessionCompoundIdThe method has no effect ifnull.authNotesFragment-Map<String, String>Map with authNote values. Auth note is removed if the corresponding value in the map isnull. Map itself can't benull.
-
-