public class MapRootAuthenticationSessionProvider<K> extends Object implements AuthenticationSessionProvider
Modifier and Type | Field and Description |
---|---|
protected MapKeycloakTransaction<K,MapRootAuthenticationSessionEntity<K>,RootAuthenticationSessionModel> |
tx |
Constructor and Description |
---|
MapRootAuthenticationSessionProvider(KeycloakSession session,
MapStorage<K,MapRootAuthenticationSessionEntity<K>,RootAuthenticationSessionModel> sessionStore) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
RootAuthenticationSessionModel |
createRootAuthenticationSession(RealmModel realm)
Creates and registers a new authentication session with random ID.
|
RootAuthenticationSessionModel |
createRootAuthenticationSession(RealmModel realm,
String id)
Creates a new root authentication session specified by the provided realm and id.
|
RootAuthenticationSessionModel |
getRootAuthenticationSession(RealmModel realm,
String authenticationSessionId)
Returns the root authentication session specified by the provided realm and id.
|
void |
onClientRemoved(RealmModel realm,
ClientModel client)
Removes all associated root authentication sessions to the given realm and client which was removed.
|
void |
onRealmRemoved(RealmModel realm)
Removes all associated root authentication sessions to the given realm which was removed.
|
void |
removeAllExpired()
Remove expired authentication sessions in all the realms
|
void |
removeExpired(RealmModel realm)
Removes all expired root authentication sessions for the given realm.
|
void |
removeRootAuthenticationSession(RealmModel realm,
RootAuthenticationSessionModel authenticationSession)
Removes provided root authentication session.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createRootAuthenticationSession
protected final MapKeycloakTransaction<K,MapRootAuthenticationSessionEntity<K>,RootAuthenticationSessionModel> tx
public MapRootAuthenticationSessionProvider(KeycloakSession session, MapStorage<K,MapRootAuthenticationSessionEntity<K>,RootAuthenticationSessionModel> sessionStore)
public RootAuthenticationSessionModel createRootAuthenticationSession(RealmModel realm)
AuthenticationSessionProvider
createRootAuthenticationSession
in interface AuthenticationSessionProvider
realm
- RealmModel
Can't be null
.RootAuthenticationSessionModel
. Never returns null
.public RootAuthenticationSessionModel createRootAuthenticationSession(RealmModel realm, String id)
AuthenticationSessionProvider
createRootAuthenticationSession
in interface AuthenticationSessionProvider
realm
- RealmModel
Can't be null
.id
- String
Id of newly created root authentication session. If null
a random id will be generated.RootAuthenticationSessionModel
. Never returns null
.public RootAuthenticationSessionModel getRootAuthenticationSession(RealmModel realm, String authenticationSessionId)
AuthenticationSessionProvider
getRootAuthenticationSession
in interface AuthenticationSessionProvider
realm
- RealmModel
Can't be null
.authenticationSessionId
- RootAuthenticationSessionModel
If null
then null
will be returned.RootAuthenticationSessionModel
or null
if no root authentication session is found.public void removeRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession)
AuthenticationSessionProvider
removeRootAuthenticationSession
in interface AuthenticationSessionProvider
realm
- RealmModel
Associated realm to the given root authentication session.authenticationSession
- RootAuthenticationSessionModel
Can't be null
.public void removeAllExpired()
AuthenticationSessionProvider
removeAllExpired
in interface AuthenticationSessionProvider
public void removeExpired(RealmModel realm)
AuthenticationSessionProvider
removeExpired
in interface AuthenticationSessionProvider
realm
- RealmModel
Can't be null
.public void onRealmRemoved(RealmModel realm)
AuthenticationSessionProvider
onRealmRemoved
in interface AuthenticationSessionProvider
realm
- RealmModel
Can't be null
.public void onClientRemoved(RealmModel realm, ClientModel client)
AuthenticationSessionProvider
onClientRemoved
in interface AuthenticationSessionProvider
realm
- RealmModel
Can't be null
.client
- ClientModel
Can't be null
.public void updateNonlocalSessionAuthNotes(AuthenticationSessionCompoundId compoundId, Map<String,String> authNotesFragment)
AuthenticationSessionProvider
updateNonlocalSessionAuthNotes
in interface AuthenticationSessionProvider
compoundId
- AuthenticationSessionCompoundId
The method has no effect if null
.authNotesFragment
- Map<String, String>
Map with authNote values.
Auth note is removed if the corresponding value in the map is null
. Map itself can't be null
.Copyright © 2021 JBoss by Red Hat. All rights reserved.