use of org.keycloak.sessions.AuthenticationSessionProvider in project keycloak by keycloak.
the class RealmManager method removeRealm.
public boolean removeRealm(RealmModel realm) {
ClientModel masterAdminClient = realm.getMasterAdminClient();
boolean removed = model.removeRealm(realm.getId());
if (removed) {
if (masterAdminClient != null) {
session.clients().removeClient(getKeycloakAdminstrationRealm(), masterAdminClient.getId());
}
UserSessionProvider sessions = session.sessions();
if (sessions != null) {
sessions.onRealmRemoved(realm);
}
AuthenticationSessionProvider authSessions = session.authenticationSessions();
if (authSessions != null) {
authSessions.onRealmRemoved(realm);
}
// Refresh periodic sync tasks for configured storageProviders
UserStorageSyncManager storageSync = new UserStorageSyncManager();
realm.getUserStorageProvidersStream().forEachOrdered(provider -> storageSync.notifyToRefreshPeriodicSync(session, realm, provider, true));
}
return removed;
}
use of org.keycloak.sessions.AuthenticationSessionProvider in project keycloak by keycloak.
the class ClientManager method removeClient.
public boolean removeClient(RealmModel realm, ClientModel client) {
if (!isInternalClient(realm.getName(), client.getClientId()) && realm.removeClient(client.getId())) {
UserSessionProvider sessions = realmManager.getSession().sessions();
if (sessions != null) {
sessions.onClientRemoved(realm, client);
}
AuthenticationSessionProvider authSessions = realmManager.getSession().authenticationSessions();
if (authSessions != null) {
authSessions.onClientRemoved(realm, client);
}
UserModel serviceAccountUser = realmManager.getSession().users().getServiceAccount(client);
if (serviceAccountUser != null) {
new UserManager(realmManager.getSession()).removeUser(realm, serviceAccountUser);
}
return true;
} else {
return false;
}
}
Aggregations