|
|
@ -209,9 +209,8 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|
|
|
userWrapper.getEmailAddress());
|
|
|
|
userWrapper.getEmailAddress());
|
|
|
|
if (StringUtils.isNotEmpty(userWrapper.getPassword())) {
|
|
|
|
if (StringUtils.isNotEmpty(userWrapper.getPassword())) {
|
|
|
|
// Decoding Base64 encoded password
|
|
|
|
// Decoding Base64 encoded password
|
|
|
|
byte[] decodedBytes = Base64.decodeBase64(userWrapper.getPassword());
|
|
|
|
|
|
|
|
userStoreManager.updateCredentialByAdmin(userWrapper.getUsername(),
|
|
|
|
userStoreManager.updateCredentialByAdmin(userWrapper.getUsername(),
|
|
|
|
new String(decodedBytes, "UTF-8"));
|
|
|
|
userWrapper.getPassword());
|
|
|
|
log.debug("User credential of username: " + userWrapper.getUsername() + " has been changed");
|
|
|
|
log.debug("User credential of username: " + userWrapper.getUsername() + " has been changed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<String> currentRoles = this.getFilteredRoles(userStoreManager, userWrapper.getUsername());
|
|
|
|
List<String> currentRoles = this.getFilteredRoles(userStoreManager, userWrapper.getUsername());
|
|
|
@ -248,7 +247,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|
|
|
userWrapper.getUsername() + " doesn't exists. Therefore, request made to update user was " +
|
|
|
|
userWrapper.getUsername() + " doesn't exists. Therefore, request made to update user was " +
|
|
|
|
"refused.").build();
|
|
|
|
"refused.").build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (UserStoreException | UnsupportedEncodingException e) {
|
|
|
|
} catch (UserStoreException e) {
|
|
|
|
String msg = "Exception in trying to update user by username: " + userWrapper.getUsername();
|
|
|
|
String msg = "Exception in trying to update user by username: " + userWrapper.getUsername();
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new UnexpectedServerErrorException(
|
|
|
|
throw new UnexpectedServerErrorException(
|
|
|
@ -305,7 +304,7 @@ public class UserManagementServiceImpl implements UserManagementService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
@GET
|
|
|
|
@Path("/{username}/roles")
|
|
|
|
@Path("/{username}/roles")
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Response getRolesOfUser(@PathParam("username") String username) {
|
|
|
|
public Response getRolesOfUser(@PathParam("username") String username) {
|
|
|
|