Commit f4d4b630 authored by michael.simon's avatar michael.simon
Browse files

Store id for nextcloud with user

Storing with registry would result in different account after
reregistration.
parent 3a19f669
......@@ -73,7 +73,6 @@ public class NextcloudProxyIdpRegisterWorkflow implements RegisterUserWorkflow,
@Override
public void deregisterUser(UserEntity user, ServiceEntity service, RegistryEntity registry, Auditor auditor)
throws RegisterException {
PropertyReader prop = PropertyReader.newRegisterPropReader(service);
}
......@@ -87,8 +86,20 @@ public class NextcloudProxyIdpRegisterWorkflow implements RegisterUserWorkflow,
public Boolean updateRegistry(UserEntity user, ServiceEntity service, RegistryEntity registry, Auditor auditor)
throws RegisterException {
registry.getRegistryValues().put("id", UUID.randomUUID().toString() + "@bwidm.de");
PropertyReader prop = PropertyReader.newRegisterPropReader(service);
String idKey = "nextcloud_user_id";
if (prop.readPropOrNull("id_key") != null) {
idKey = prop.readPropOrNull("id_key");
}
if (! user.getGenericStore().containsKey(idKey)) {
user.getGenericStore().put(idKey, UUID.randomUUID().toString() + "@bwidm.de");
}
if (! registry.getRegistryValues().containsKey("id")) {
registry.getRegistryValues().put("id", user.getGenericStore().get(idKey));
}
return false;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment