Package org.keycloak.authentication.jpa
Class JpaAuthenticationSessionProvider
java.lang.Object
org.keycloak.models.AbstractKeycloakTransaction
org.keycloak.authentication.jpa.JpaAuthenticationSessionProvider
- All Implemented Interfaces:
KeycloakTransaction,Provider,AuthenticationSessionProvider
public class JpaAuthenticationSessionProvider
extends AbstractKeycloakTransaction
implements AuthenticationSessionProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class org.keycloak.models.AbstractKeycloakTransaction
AbstractKeycloakTransaction.TransactionState -
Field Summary
Fields inherited from class org.keycloak.models.AbstractKeycloakTransaction
state -
Constructor Summary
ConstructorsConstructorDescriptionJpaAuthenticationSessionProvider(KeycloakSession session, int authSessionsLimit) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidCreates 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 id) Returns the root authentication session specified by the provided realm and id.voidonRealmRemoved(RealmModel realm) Removes all associated root authentication sessions to the given realm which was removed.voidremoveRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession) Removes provided root authentication session.protected voidMethods inherited from class org.keycloak.models.AbstractKeycloakTransaction
begin, beginImpl, commit, getRollbackOnly, getState, isActive, rollback, setRollbackOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.sessions.AuthenticationSessionProvider
migrate, onClientRemoved, removeAllExpired, removeExpired, updateNonlocalSessionAuthNotes
-
Constructor Details
-
JpaAuthenticationSessionProvider
-
-
Method Details
-
createRootAuthenticationSession
Description copied from interface:AuthenticationSessionProviderCreates and registers a new authentication session with random ID. Authentication session entity will be prefilled with current timestamp, the given realm and client.- Specified by:
createRootAuthenticationSessionin interfaceAuthenticationSessionProvider- Parameters:
realm-RealmModelCan't benull.- Returns:
- Returns created
RootAuthenticationSessionModel. Never returnsnull.
-
createRootAuthenticationSession
Description copied from interface:AuthenticationSessionProviderCreates a new root authentication session specified by the provided realm and id.- Specified by:
createRootAuthenticationSessionin interfaceAuthenticationSessionProvider- 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
Description copied from interface:AuthenticationSessionProviderReturns the root authentication session specified by the provided realm and id.- Specified by:
getRootAuthenticationSessionin interfaceAuthenticationSessionProvider- Parameters:
realm-RealmModelCan't benull.id-RootAuthenticationSessionModelIfnullthennullwill be returned.- Returns:
- Returns found
RootAuthenticationSessionModelornullif no root authentication session is found.
-
removeRootAuthenticationSession
public void removeRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession) Description copied from interface:AuthenticationSessionProviderRemoves provided root authentication session.- Specified by:
removeRootAuthenticationSessionin interfaceAuthenticationSessionProvider- Parameters:
realm-RealmModelAssociated realm to the given root authentication session.authenticationSession-RootAuthenticationSessionModelCan't benull.
-
onRealmRemoved
Description copied from interface:AuthenticationSessionProviderRemoves all associated root authentication sessions to the given realm which was removed.- Specified by:
onRealmRemovedin interfaceAuthenticationSessionProvider- Parameters:
realm-RealmModelCan't benull.
-
close
public void close() -
commitImpl
protected void commitImpl()- Specified by:
commitImplin classAbstractKeycloakTransaction
-
rollbackImpl
protected void rollbackImpl()- Specified by:
rollbackImplin classAbstractKeycloakTransaction
-