{"action":"created","issue":{"url":"https://api.github.com/repos/JOBAA/amos-ss15-proj4/issues/68","labels_url":"https://api.github.com/repos/JOBAA/amos-ss15-proj4/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/JOBAA/amos-ss15-proj4/issues/68/comments","events_url":"https://api.github.com/repos/JOBAA/amos-ss15-proj4/issues/68/events","html_url":"https://github.com/JOBAA/amos-ss15-proj4/issues/68","id":87507446,"number":68,"title":"Password revocery feature - new password is not accepted at authentication","user":{"login":"BujakiAttila","id":2914096,"avatar_url":"https://avatars.githubusercontent.com/u/2914096?v=3","gravatar_id":"","url":"https://api.github.com/users/BujakiAttila","html_url":"https://github.com/BujakiAttila","followers_url":"https://api.github.com/users/BujakiAttila/followers","following_url":"https://api.github.com/users/BujakiAttila/following{/other_user}","gists_url":"https://api.github.com/users/BujakiAttila/gists{/gist_id}","starred_url":"https://api.github.com/users/BujakiAttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BujakiAttila/subscriptions","organizations_url":"https://api.github.com/users/BujakiAttila/orgs","repos_url":"https://api.github.com/users/BujakiAttila/repos","events_url":"https://api.github.com/users/BujakiAttila/events{/privacy}","received_events_url":"https://api.github.com/users/BujakiAttila/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JOBAA/amos-ss15-proj4/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-11T21:32:49Z","updated_at":"2015-07-13T11:43:13Z","closed_at":null,"body":"By the 'Forgot Password' feature generated password is not working. The email sent with the generated password with no problem, but the generated password is not accepted at authentication. \r\n\r\nClientController.java - ClientForgotPassword method generates the password hash:\r\n\r\n`String newPasswordHash = new BCryptPasswordEncoder().encode(newRandomPassword);`\r\n\r\nThis is not creating a valid hash. When trying to log in on the user interface using the \"newRandomPassword\", the credentials are not accepted. Maybe salting is not done properly? Any ideas?"},"comment":{"url":"https://api.github.com/repos/JOBAA/amos-ss15-proj4/issues/comments/120899260","html_url":"https://github.com/JOBAA/amos-ss15-proj4/issues/68#issuecomment-120899260","issue_url":"https://api.github.com/repos/JOBAA/amos-ss15-proj4/issues/68","id":120899260,"user":{"login":"BujakiAttila","id":2914096,"avatar_url":"https://avatars.githubusercontent.com/u/2914096?v=3","gravatar_id":"","url":"https://api.github.com/users/BujakiAttila","html_url":"https://github.com/BujakiAttila","followers_url":"https://api.github.com/users/BujakiAttila/followers","following_url":"https://api.github.com/users/BujakiAttila/following{/other_user}","gists_url":"https://api.github.com/users/BujakiAttila/gists{/gist_id}","starred_url":"https://api.github.com/users/BujakiAttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BujakiAttila/subscriptions","organizations_url":"https://api.github.com/users/BujakiAttila/orgs","repos_url":"https://api.github.com/users/BujakiAttila/repos","events_url":"https://api.github.com/users/BujakiAttila/events{/privacy}","received_events_url":"https://api.github.com/users/BujakiAttila/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T11:43:13Z","updated_at":"2015-07-13T11:43:13Z","body":"I think we should use the UserService class to update the password as described here:\r\n[Password reset tutorial](http://www.baeldung.com/spring-security-registration-i-forgot-my-password)\r\n\r\nMaybe something like this should be done instead of the current solution:\r\n```java\r\n@RequestMapping(value = \"/user/savePassword\", method = RequestMethod.POST)\r\n@PreAuthorize(\"hasRole('READ_PRIVILEGE')\")\r\n@ResponseBody\r\npublic GenericResponse savePassword(Locale locale, @RequestParam(\"password\") String password) {\r\n    User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n    userService.changeUserPassword(user, password);\r\n    return new GenericResponse(messages.getMessage(\"message.resetPasswordSuc\", null, locale));\r\n}\r\n```"}}