mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Encode password using UserAuthenticator
This commit is contained in:
parent
4f53eb11f0
commit
519ca619df
@ -1756,7 +1756,19 @@ public class AccountManagerImpl implements AccountManager, Manager {
|
|||||||
s_logger.debug("Creating user: " + userName + ", accountId: " + accountId + " timezone:" + timezone);
|
s_logger.debug("Creating user: " + userName + ", accountId: " + accountId + " timezone:" + timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
UserVO user = _userDao.persist(new UserVO(accountId, userName, password, firstName, lastName, email, timezone, UUID.randomUUID().toString(), _regionMgr.getId()));
|
String encodedPassword = null;
|
||||||
|
for (Enumeration<UserAuthenticator> en = _userAuthenticators.enumeration(); en.hasMoreElements();) {
|
||||||
|
UserAuthenticator authenticator = en.nextElement();
|
||||||
|
encodedPassword = authenticator.encode(password);
|
||||||
|
if (encodedPassword != null) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (encodedPassword == null) {
|
||||||
|
throw new CloudRuntimeException("Failed to encode password");
|
||||||
|
}
|
||||||
|
|
||||||
|
UserVO user = _userDao.persist(new UserVO(accountId, userName, encodedPassword, firstName, lastName, email, timezone, UUID.randomUUID().toString(), _regionMgr.getId()));
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user