KEYCLOAK-4282 Import authorization after users are imported
This commit is contained in:
parent
a18a4477e0
commit
194a63cc71
2 changed files with 10 additions and 7 deletions
|
@ -279,13 +279,6 @@ public class RepresentationToModel {
|
|||
}
|
||||
}
|
||||
|
||||
if (rep.getClients() != null) {
|
||||
rep.getClients().forEach(clientRepresentation -> {
|
||||
ClientModel client = newRealm.getClientByClientId(clientRepresentation.getClientId());
|
||||
importAuthorizationSettings(clientRepresentation, client, session);
|
||||
});
|
||||
}
|
||||
|
||||
if (rep.getSmtpServer() != null) {
|
||||
newRealm.setSmtpConfig(new HashMap(rep.getSmtpServer()));
|
||||
}
|
||||
|
@ -331,6 +324,13 @@ public class RepresentationToModel {
|
|||
}
|
||||
}
|
||||
|
||||
if (rep.getClients() != null) {
|
||||
rep.getClients().forEach(clientRepresentation -> {
|
||||
ClientModel client = newRealm.getClientByClientId(clientRepresentation.getClientId());
|
||||
importAuthorizationSettings(clientRepresentation, client, session);
|
||||
});
|
||||
}
|
||||
|
||||
if(rep.isInternationalizationEnabled() != null){
|
||||
newRealm.setInternationalizationEnabled(rep.isInternationalizationEnabled());
|
||||
}
|
||||
|
|
|
@ -34,6 +34,9 @@ public class SingleFileImportProviderFactory implements ImportProviderFactory {
|
|||
@Override
|
||||
public ImportProvider create(KeycloakSession session) {
|
||||
String fileName = ExportImportConfig.getFile();
|
||||
if (fileName == null) {
|
||||
throw new IllegalArgumentException("Property " + ExportImportConfig.FILE + " needs to be provided!");
|
||||
}
|
||||
return new SingleFileImportProvider(new File(fileName));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue