UserStoreManager userStore = this.realm.getUserStoreManager();
HttpServletRequest request = (HttpServletRequest) MessageContext
.getCurrentMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
HttpSession httpSession = request.getSession(false);
String userName = (String) httpSession.getAttribute(ServerConstants.USER_LOGGED_IN);
userStore.updateCredential(userName, newPassword, oldPassword);
} catch (UserStoreException e) {
// previously logged so logging not needed
throw new UserAdminException(e.getMessage(), e);
}
}