Remove user from KC after removing from federation
This commit is contained in:
parent
ad606cbce6
commit
0f4497e53e
2 changed files with 12 additions and 3 deletions
|
@ -63,8 +63,7 @@ public class KerberosFederationProvider implements UserFederationProvider {
|
|||
|
||||
@Override
|
||||
public boolean removeUser(RealmModel realm, UserModel user) {
|
||||
// TODO: Not sure if federation provider is expected to delete user in localStorage. Looks rather like a bug in UserFederationManager.removeUser .
|
||||
return session.userStorage().removeUser(realm, user);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,7 +67,17 @@ public class UserFederationManager implements UserProvider {
|
|||
public boolean removeUser(RealmModel realm, UserModel user) {
|
||||
UserFederationProvider link = getFederationLink(realm, user);
|
||||
if (link != null) {
|
||||
return link.removeUser(realm, user);
|
||||
boolean fedRemoved = link.removeUser(realm, user);
|
||||
if (fedRemoved) {
|
||||
boolean localRemoved = session.userStorage().removeUser(realm, user);
|
||||
if (!localRemoved) {
|
||||
logger.warn("User removed from federation provider, but failed to remove him from keycloak model");
|
||||
}
|
||||
return localRemoved;
|
||||
} else {
|
||||
logger.warn("Failed to remove user from federation provider");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return session.userStorage().removeUser(realm, user);
|
||||
|
||||
|
|
Loading…
Reference in a new issue