Commit 8134c470 authored by michael.simon's avatar michael.simon
Browse files

Fix nextcloud deregistration

when accounts are not present in nextcloud anymore
parent 8835aa72
......@@ -109,11 +109,26 @@ public class NextcloudProxyIdpRegisterWorkflow implements RegisterUserWorkflow,
PropertyReader prop = PropertyReader.newRegisterPropReader(service);
NextcloudWorker worker = new NextcloudWorker(prop);
NextcloudAnswer answer = worker.disableAccount(registry);
NextcloudAnswer answer = worker.loadAccount(registry);
if (answer.getMeta().getStatusCode() == 100) {
if (answer.getUser() != null) {
answer = worker.disableAccount(registry);
if (answer.getMeta().getStatusCode() != 100) {
logger.warn("Disabling of registry {} for user {} failed", registry.getId(), user.getEppn());
throw new RegisterException("Failed to disable account");
}
else {
logger.info("Account for registry {} and user {} disabled", registry.getId(), user.getEppn());
}
}
else {
logger.info("Account for registry {} and user {} does not exist in nextcloud. Deregister anyway.", registry.getId(), user.getEppn());
}
}
else {
logger.info("Account for registry {} and user {} does not exist in nextcloud. Deregister anyway.", registry.getId(), user.getEppn());
}
}
@Override
......
Supports Markdown
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