if(admin) {
log.audit("No OLAT Auth. provider migrated for admin: " + identity.getName());
continue;
}
Authentication olatAuth = null, webDAVAuth = null, shibAuth = null;
List<Authentication> auths = secMgr.getAuthentications(identity);
for(Authentication auth:auths) {
if(WebDAVAuthManager.PROVIDER_WEBDAV.equals(auth.getProvider())) {
webDAVAuth = auth;
} else if(OLATAuthenticationController.PROVIDER_OLAT.equals(auth.getProvider())) {
olatAuth = auth;
} else if(ShibbolethDispatcher.PROVIDER_SHIB.equals(auth.getProvider())) {
shibAuth = auth;
}
}
if(webDAVAuth == null && olatAuth != null && shibAuth != null) {
String hashedPwd = olatAuth.getCredential();
log.audit("Create WebDAV Auth. provider for: " + identity.getName());
webDAVAuth = ManagerFactory.getManager().createAndPersistAuthentication(identity, WebDAVAuthManager.PROVIDER_WEBDAV, identity.getName(), hashedPwd);
if(webDAVAuth != null) {
log.audit("Delete OLAT Auth. provider for: " + identity.getName());
ManagerFactory.getManager().deleteAuthentication(olatAuth);