remove toggle federation when syncing
This commit is contained in:
parent
a0958f728d
commit
ff58a5664b
2 changed files with 4 additions and 4 deletions
|
@ -72,6 +72,10 @@ public class ScimClient {
|
||||||
M kcModel) {
|
M kcModel) {
|
||||||
var adapter = getAdapter(aClass);
|
var adapter = getAdapter(aClass);
|
||||||
adapter.apply(kcModel);
|
adapter.apply(kcModel);
|
||||||
|
// If mapping exist then it was created by import so skip.
|
||||||
|
if (adapter.query("findById", adapter.getId()).getSingleResult() != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var retry = registry.retry("create-" + adapter.getId());
|
var retry = registry.retry("create-" + adapter.getId());
|
||||||
var resource = retry.executeSupplier(() -> {
|
var resource = retry.executeSupplier(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -110,13 +110,9 @@ public class ScimStorageProviderFactory
|
||||||
RealmModel realm = session.realms().getRealm(realmId);
|
RealmModel realm = session.realms().getRealm(realmId);
|
||||||
session.getContext().setRealm(realm);
|
session.getContext().setRealm(realm);
|
||||||
var client = new ScimClient(model, session);
|
var client = new ScimClient(model, session);
|
||||||
model.setEnabled(false);
|
|
||||||
realm.updateComponent(model);
|
|
||||||
client.sync(UserAdapter.class, result);
|
client.sync(UserAdapter.class, result);
|
||||||
client.sync(GroupAdapter.class, result);
|
client.sync(GroupAdapter.class, result);
|
||||||
client.close();
|
client.close();
|
||||||
model.setEnabled(true);
|
|
||||||
realm.updateComponent(model);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue