Merge pull request #3832 from stianst/KEYCLOAK-4370

KEYCLOAK-4370 Prevent LDAP provider from being migrated twice
This commit is contained in:
Stian Thorgersen 2017-02-06 08:21:30 +01:00 committed by GitHub
commit 1c7de24084
2 changed files with 3 additions and 2 deletions

View file

@ -40,7 +40,9 @@ public class MigrateUserFedToComponent extends AbstractUserFedToComponent {
protected void generateStatementsImpl() throws CustomChangeException {
List<ProviderFactory> factories = kcSession.getKeycloakSessionFactory().getProviderFactories(UserStorageProvider.class);
for (ProviderFactory factory : factories) {
convertFedProviderToComponent(factory.getId(), null);
if (!factory.getId().equals(LDAPConstants.LDAP_PROVIDER)) {
convertFedProviderToComponent(factory.getId(), null);
}
}
}

View file

@ -27,7 +27,6 @@ public class PortLdapUserFedToComponentModel extends AbstractUserFedToComponent
@Override
protected void generateStatementsImpl() throws CustomChangeException {
String providerId = LDAPConstants.LDAP_PROVIDER;
convertFedProviderToComponent(LDAPConstants.LDAP_PROVIDER, "org.keycloak.storage.ldap.mappers.LDAPStorageMapper");
}