use of fi.otavanopisto.pyramus.rest.model.UserCredentials in project muikku by otavanopisto.
the class PyramusUserSchoolDataBridge method updateUserCredentials.
@Override
public void updateUserCredentials(String userIdentifier, String oldPassword, String newUsername, String newPassword) {
Long personId = getPersonId(userIdentifier);
if (personId == null) {
logger.warning(String.format("PyramusUserSchoolDataBridge.updateUserCredentials malformed user identifier %s", userIdentifier));
throw new SchoolDataBridgeInternalException(String.format("Malformed user identifier %s\n%s", userIdentifier, ExceptionUtils.getStackTrace(new Throwable())));
}
try {
UserCredentials change = new UserCredentials(oldPassword, newUsername, newPassword);
pyramusClient.put("/persons/persons/" + personId + "/credentials", change);
} catch (PyramusRestClientUnauthorizedException purr) {
throw new SchoolDataBridgeUnauthorizedException(purr.getMessage());
}
}
Aggregations