public boolean setPassword(String username, String passwd) throws AppsForYourDomainException, ServiceException, IOException {
ShaPasswordEncoder pwe = new ShaPasswordEncoder();
String passwordHashFunction = pwe.getAlgorithm();
passwd = pwe.encodePassword(passwd, null);
UserEntry entry = retrieveUser(username);
Login login = entry.getLogin();
login.setPassword(passwd);
if (passwordHashFunction != null) {
login.setHashFunctionName(passwordHashFunction);
}
login.setChangePasswordAtNextLogin(false);
@SuppressWarnings("unused")
UserEntry result = updateUser(username, entry);
return true;
}