ASP.NET Membership - Change password without asking the old - Web Dev And Stuff
Monday, September 28, 2009 6:25 AM djsolid

ASP.NET Membership - Change password without asking the old

Recently I was in a situation where a user was required to change the password upon first login.

But MembershipUser’s ChangePassword requires 2 arguments. [read more…]

Filed under:

Comments

# ASP.NET Membership - Change password without asking the old

Sunday, September 27, 2009 11:41 PM by DotNetKicks.com

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# ASP.NET Membership - Change password without asking the old

Sunday, September 27, 2009 11:46 PM by DotNetBurner - ASP.net

DotNetBurner - burning hot .net content

# ASP.NET Membership - Change password without asking the old

Monday, September 28, 2009 3:11 AM by DotNetShoutout

Thank you for submitting this cool story - Trackback from DotNetShoutout

# ASP.NET Membership - Change password without asking the old - Web Dev And Stuff

Monday, September 28, 2009 9:52 AM by Servefault.com

Thank you for submitting this cool story - Trackback from Servefault.com

# re: ASP.NET Membership - Change password without asking the old

Thursday, October 01, 2009 10:42 AM by PhillyBones

Thanks! I was trying to get the password via the user's Membership data, not realizing that it was looking for the clear text, not the hashed value stored in the database.

# re: ASP.NET Membership - Change password without asking the old

Friday, October 02, 2009 12:09 PM by antonio machado

tks a lot

# re: ASP.NET Membership - Change password without asking the old

Friday, October 09, 2009 12:55 PM by Jesse

You could also use the GetPassword() function instead of auto generating a new one.  Not sure if this is a big deal or not, but just FYI:

user.ChangePassword(user.GetPassword(), "NewPwHere")

# re: ASP.NET Membership - Change password without asking the old

Wednesday, October 14, 2009 12:49 AM by djsolid

Jesse this works only if you store the password in an encrypted way and not in a hashed.

# re: ASP.NET Membership - Change password without asking the old

Friday, October 30, 2009 7:03 AM by a

Thanks a lot, great tip - I was just scratching my head how to change the password when it's stored as hashed.

# re: ASP.NET Membership - Change password without asking the old

Saturday, November 21, 2009 11:36 PM by phuonglewis

thank you so much. U've kicked me out of stuck.

# re: ASP.NET Membership - Change password without asking the old

Tuesday, December 29, 2009 9:06 AM by grewalsonali

nice article

# re: ASP.NET Membership - Change password without asking the old

Tuesday, February 09, 2010 3:24 PM by Randy

Yet another thanks for an elegant, simple solution!

# re: ASP.NET Membership - Change password without asking the old

Wednesday, February 17, 2010 11:31 AM by Diaa

easy and brilliance

Thanx

# re: ASP.NET Membership - Change password without asking the old

Friday, April 16, 2010 11:34 PM by DR

Great post, just what I was looking for.

# re: ASP.NET Membership - Change password without asking the old

Saturday, April 17, 2010 11:49 AM by Richard David

My site requires a Question and Answer, so I can't get past the Reset Password step without it.  And, of course the Answer is hashed as well.

Any ideas?

# re: ASP.NET Membership - Change password without asking the old

Tuesday, April 20, 2010 4:55 PM by Peter D.

I have the same problem as Richard has posted.

I need to have the Question And Answer set True.

I have tried to get around it and still could not figure it out.

Thanks,

# ASP.NET Membership - Change password without asking the old (WITH Question and Answer)

Wednesday, April 21, 2010 2:26 AM by Web Dev And Stuff

I have received many comments and questions about how you can do what is described in this post when

# re: ASP.NET Membership - Change password without asking the old

Wednesday, May 19, 2010 8:30 AM by Jedidja

Great stuff! :) Should put this on StackOverflow...

# re: ASP.NET Membership - Change password without asking the old

Friday, June 04, 2010 6:16 AM by kuntal

thanks

# Change passwor | DigImages

Sunday, June 06, 2010 6:14 AM by Change passwor | DigImages

Pingback from  Change passwor | DigImages

# re: ASP.NET Membership - Change password without asking the old

Friday, June 25, 2010 11:32 AM by KenInNH

For those with requiresQuestionAndAnswer set to true, see this article for a workaround:

peterkellner.net/.../resetpasswordaspnet

# re: ASP.NET Membership - Change password without asking the old

Thursday, September 09, 2010 6:54 AM by Pål Andreassen

Nice tip. Was just wondering on how an administrator could change a user's password.

# re: ASP.NET Membership - Change password without asking the old

Wednesday, November 03, 2010 9:57 AM by joseabad

You've been kicked good ONE man!!! Works Perfect

# re: ASP.NET Membership - Change password without asking the old

Thursday, November 25, 2010 10:04 AM by fgpx78

I use this trick a lot, but what about validation? If the new password is not valid, the user cannot log on anymore until you give a valid one. Is there ny way to vlidate the password strenght before doing the ResetPassword?

# re: ASP.NET Membership - Change password without asking the old

Wednesday, March 23, 2011 12:00 AM by Anon

MembershipUser user = Membership.GetUser();

string genPasswrd = user.ResetPassword();

//email user genPasswrd

# re: ASP.NET Membership - Change password without asking the old

Monday, September 05, 2011 1:31 AM by beverly

Los muchas gracias.      

http://www.shampes.com/      

kenyon

# re: ASP.NET Membership - Change password without asking the old

Tuesday, September 13, 2011 6:34 PM by hooher tod

Yes there should realize the reader to RSS my feed to RSS commentary, quite simply

# re: ASP.NET Membership - Change password without asking the old

Saturday, November 05, 2011 2:31 AM by AnnaBodge

Great stuff  at least I thing so. Keep posting this way!

Anna Bodge

<a href="delhiescortservice.com/">escorts delhi</a>

# re: ASP.NET Membership - Change password without asking the old

Tuesday, December 13, 2011 12:30 AM by s

Have to retrieve Password From sqlsever to asp.net

# re: ASP.NET Membership - Change password without asking the old

Wednesday, December 14, 2011 1:40 PM by Zhen

I was trying to use aspnet_Membership_setPassword to change ASP.NET password, the new password that I input was clear text. When the password had been changed. it didn't work. Do have to encrypt the new password before I change it?

Leave a Comment

(required) 
(required) 
(optional)
(required)