2

I'm relatively new to authentication.

I've set up users and roles using the Web Site Administration Tool you get to by clicking the icon above the solution explorer in Visual Studio.

This all works fine. However I want to know how to set it up to when you create a user it randomly generates a password. Also I would like it so the user can go and change there password. Do you have to set this functionality up yourself in your app or is there a built in mechanism?

AnonyMouse
  • 16,228
  • 23
  • 74
  • 128

2 Answers2

0

You can generate a random password a few ways. Check out this link. It's a great example showing how to do it with GUIDs (except take out the dashes and only use the first n characters of the GUID).

You can also use the Membership.GeneratePassword() method. That's a great built-in solution.

When you want your user to change their password, you can input the new password parameters into the MembershipProvider.ChangePassword() method.

0

Not sure if you're using forms based authentication, but the The Definitive Guide To Forms based Website Authentication here on SO is fantastic, and most likely will answer all your questions.

Community
  • 1
  • 1
Erik Philips
  • 48,663
  • 7
  • 112
  • 142