Search in sources :

Example 1 with UserFederationLinkRemovedEvent

use of org.keycloak.models.cache.infinispan.events.UserFederationLinkRemovedEvent in project keycloak by keycloak.

the class UserCacheSession method removeFederatedIdentity.

@Override
public boolean removeFederatedIdentity(RealmModel realm, UserModel user, String socialProvider) {
    // Needs to invalidate both directions
    FederatedIdentityModel socialLink = getFederatedIdentity(realm, user, socialProvider);
    UserFederationLinkRemovedEvent event = UserFederationLinkRemovedEvent.create(user.getId(), realm.getId(), socialLink);
    cache.federatedIdentityLinkRemovedInvalidation(user.getId(), realm.getId(), event.getIdentityProviderId(), event.getSocialUserId(), invalidations);
    invalidationEvents.add(event);
    return getDelegate().removeFederatedIdentity(realm, user, socialProvider);
}
Also used : UserFederationLinkRemovedEvent(org.keycloak.models.cache.infinispan.events.UserFederationLinkRemovedEvent) FederatedIdentityModel(org.keycloak.models.FederatedIdentityModel)

Aggregations

FederatedIdentityModel (org.keycloak.models.FederatedIdentityModel)1 UserFederationLinkRemovedEvent (org.keycloak.models.cache.infinispan.events.UserFederationLinkRemovedEvent)1