Package org.keycloak.sessions
Interface AuthenticationSessionProvider
- All Superinterfaces:
Provider
- All Known Implementing Classes:
InfinispanAuthenticationSessionProvider,RemoteInfinispanAuthenticationSessionProvider
- Author:
- Marek Posolda
-
Method Summary
Modifier and TypeMethodDescriptionCreates and registers a new authentication session with random ID.createRootAuthenticationSession(RealmModel realm, String id) Creates a new root authentication session specified by the provided realm and id.getRootAuthenticationSession(RealmModel realm, String authenticationSessionId) Returns the root authentication session specified by the provided realm and id.default voidvoidonClientRemoved(RealmModel realm, ClientModel client) Deprecated, for removal: This API element is subject to removal in a future version.to remove, all implementations are empty.voidonRealmRemoved(RealmModel realm) Removes all associated root authentication sessions to the given realm which was removed.default voidDeprecated, for removal: This API element is subject to removal in a future version.manual removal of expired entities should not be used anymore.default voidremoveExpired(RealmModel realm) Deprecated, for removal: This API element is subject to removal in a future version.manual removal of expired entities should not be used anymore.voidremoveRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession) Removes provided root authentication session.default voidupdateNonlocalSessionAuthNotes(AuthenticationSessionCompoundId compoundId, Map<String, String> authNotesFragment) Deprecated, for removal: This API element is subject to removal in a future version.For removal in Keycloak 27
-
Method Details
-
createRootAuthenticationSession
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
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
Deprecated, for removal: This API element is subject to removal in a future version.manual removal of expired entities should not be used anymore. It is responsibility of the store implementation to handle expirable entitiesRemove expired authentication sessions in all the realms -
removeExpired
Deprecated, for removal: This API element is subject to removal in a future version.manual removal of expired entities should not be used anymore. It is responsibility of the store implementation to handle expirable entitiesRemoves all expired root authentication sessions for the given realm.- Parameters:
realm-RealmModelCan't benull.
-
onRealmRemoved
Removes all associated root authentication sessions to the given realm which was removed.- Parameters:
realm-RealmModelCan't benull.
-
onClientRemoved
@Deprecated(since="26.5", forRemoval=true) void onClientRemoved(RealmModel realm, ClientModel client) Deprecated, for removal: This API element is subject to removal in a future version.to remove, all implementations are empty.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
@Deprecated(since="26.3", forRemoval=true) default void updateNonlocalSessionAuthNotes(AuthenticationSessionCompoundId compoundId, Map<String, String> authNotesFragment) Deprecated, for removal: This API element is subject to removal in a future version.For removal in Keycloak 27Requests 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.
-
migrate
-