reset-password

Pattern for allowing a user to change his password. Should the user have to repeat the new password as well as enter the old password?

末鹿安然 提交于 2019-12-08 19:47:50
问题 There are lots of questions about recovering passwords on SO, but not about changing passwords considering one of the two following: 1) The user is authenticated in the system already (either through user/pw or through third part authentication e.g. facebook/twitter) 2) The user knows his or her old password. Given these starting points, I have two distinct question as to what the best practice is for allowing a user to change his or her password in the fewest steps. Scenario (user has

Django Rest Auth custom reset password confirm url

社会主义新天地 提交于 2019-12-05 08:12:37
问题 With django-rest-framework, when you post a reset password (rest-auth/password/reset/), there is an email send to the user email. This email contains a confirmation URL. I would like to change this url because I'm on a REST app case, I want this email to point on my frontend instead of the django backend. With the confirmation email case, I had to override get_email_confirmation_url method from the AccountAdapter . But with the reset password case, I have no clue how to do it (there is no

Validation errors are triggered when I'm trying to reset password

末鹿安然 提交于 2019-12-04 05:31:32
问题 I'm using devise for authentication and I've added some other fields to the users table after setting up devise. User can sign-up by entering email and password only and after sign-up user can edit his profile. For that I've used :on => update. But now when I'm trying to reset the password validations are triggering error like name cannot be blank and blah blah. I'm using devise and using registrations#edit for resetting password. Below is my user model. class User < ActiveRecord::Base devise

Django Rest Auth custom reset password confirm url

瘦欲@ 提交于 2019-12-03 20:41:11
With django-rest-framework, when you post a reset password (rest-auth/password/reset/), there is an email send to the user email. This email contains a confirmation URL. I would like to change this url because I'm on a REST app case, I want this email to point on my frontend instead of the django backend. With the confirmation email case, I had to override get_email_confirmation_url method from the AccountAdapter . But with the reset password case, I have no clue how to do it (there is no method in the adapter about reseting password). Any idea? I did it with templatetags: https://docs

Best practice on generating reset password tokens

混江龙づ霸主 提交于 2019-12-03 03:59:06
问题 Any best practice on how a reset password token should be constructed? I'm thinking: random 17 characters [a-zA-Z0-9] + a globally unique id + random 17 characters [a-zA-Z0-9]. Is there a better solution, or an industry standard on reset password tokens? 回答1: There are some important points to consider. The code should be really random (read from MCRYPT_DEV_URANDOM), and should not be derrived from other user related information. Ideally the code is base62 encoded (A-Z a-z 0-9) to avoid

How to reset password with UserManager of ASP.NET MVC 5

让人想犯罪 __ 提交于 2019-12-03 02:44:09
问题 I am wondering if there is a way to reset password with UserManager of ASP.NET MVC 5 I tried this with user that already has a password but no success. Any clue? IdentityResult result = UserManager.AddPassword(forgotPasswordEvent.UserId.ToString(), model.ConfirmPassword); if (result.Succeeded) { // } else { AddErrors(result); } 回答1: It is here ASP.NET Identity reset password UserManager<IdentityUser> userManager = new UserManager<IdentityUser>(new UserStore<IdentityUser>()); userManager

Best practice on generating reset password tokens

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 16:19:32
Any best practice on how a reset password token should be constructed? I'm thinking: random 17 characters [a-zA-Z0-9] + a globally unique id + random 17 characters [a-zA-Z0-9]. Is there a better solution, or an industry standard on reset password tokens? martinstoeckli There are some important points to consider. The code should be really random (read from MCRYPT_DEV_URANDOM), and should not be derrived from other user related information. Ideally the code is base62 encoded (A-Z a-z 0-9) to avoid problems with the Url. Store only a hash of the token in the database , otherwise an attacker with

How to reset password with UserManager of ASP.NET MVC 5

只谈情不闲聊 提交于 2019-12-02 14:38:31
I am wondering if there is a way to reset password with UserManager of ASP.NET MVC 5 I tried this with user that already has a password but no success. Any clue? IdentityResult result = UserManager.AddPassword(forgotPasswordEvent.UserId.ToString(), model.ConfirmPassword); if (result.Succeeded) { // } else { AddErrors(result); } Developer It is here ASP.NET Identity reset password UserManager<IdentityUser> userManager = new UserManager<IdentityUser>(new UserStore<IdentityUser>()); userManager.RemovePassword(userId); userManager.AddPassword(userId, newPassword); I suppose this is newer but there

How to reset / change password in Node.js with Passport.js?

假装没事ソ 提交于 2019-11-30 00:51:23
I use Passport.js in Node.js to create a login system. Everything is ok, but I do not know how to reset user password when they forget their password or they want to change it. User model in MongoDB var UserSchema = new Schema({ email: String, username: String, provider: String, hashed_password: String, salt: String, }); Didn't really like the idea of hitting my database to store tokens, especially when you want to be creating and verifying tokens for many actions. Instead I decided to copy how Django does it : convert timestamp_today to base36 as today convert user.id to base36 as ident

django customize reset password form

南楼画角 提交于 2019-11-29 11:47:24
I am a beginner in django (django 1.7 python 2.7). I am trying to add no captcha recaptcha onto my django reset password form. I am trying to use this recaptcha djano plugin . I have followed the instructions and added the necessay settings: Installed django-recaptcha to the Python path. Added captcha to the INSTALLED_APPS setting. Added the following to my settings.py file: RECAPTCHA_PUBLIC_KEY = '76wtgdfsjhsydt7r5FFGFhgsdfytd656sad75fgh' # fake - for the purpose of this post. RECAPTCHA_PRIVATE_KEY = '98dfg6df7g56df6gdfgdfg65JHJH656565GFGFGs' # fake - for the purpose of this post. NOCAPTCHA =