throws GeronimoSecurityException {
refreshUsers();
String name = (String) properties.get("UserName");
if (users.getProperty(name) == null) {
log.warn("updateUserPrincipal() UserName="+name+" does not exist.");
throw new GeronimoSecurityException("User principal="+name+" does not exist.");
}
try {
String realPassword = (String) properties.get("Password");
if (realPassword != null) {
String digest = getDigest();
if(digest != null && !digest.equals("")) {
realPassword = digestPassword(realPassword, digest, getEncoding());
}
realPassword = EncryptionManager.encrypt(realPassword);
}
users.setProperty(name, realPassword);
store(users, serverInfo.resolveServer(getUsersURI()).toURL());
} catch (Exception e) {
throw new GeronimoSecurityException("Cannot update user principal: "
+ e.getMessage(), e);
}
}