Friday, May 22, 2009 1:57 PM
I have Two SQL Database
1 . Forum authentication (ASP.Net Membershipprovider&RoleProvider database)
2. Application Database (XXX)
Import from ApplicationDatabase(XXX) (Users details table) to Forum Authentication Database (aspnet_Users,aspnet_Membership table).
In Application Database(XXX) Textpassword and Forum Authentication (encrypted Password)
I need how to convert Textpassword to encrypted Password in C# language
I need to get those passwords into the aspnet_Membership table in SQL Server which is the table used by the MembershipProvider and I'd like to have them encrypted (not hashed) using the default encoding scheme provided by Microsoft in the SQLMembershipProvider.
- Changed Type Mike Walsh FIN Friday, May 22, 2009 2:58 PM always use the question type so people get credit for their replies to you
Friday, May 22, 2009 7:56 PMHi,
First, I think your question is not really SharePoint related, instead it is general ASP.NET 2.0 question.
It's not clear to me that there are the same users in the two databases and only the passwords must be synchronized or users should also be created in the membership DB.
You should use the membership API to achieve your goal.
How To: Use Membership in ASP.NET 2.0
You can use the MembershipUser.ChangePassword method to change the password. It is important that you have to know the current (old) passwords of the users in membership DB to change the password!
For creating new users, you can use the Membership.CreateUser method as described here
The passwordFormat for the membership provider must be configured to Encrypted.
As described here:
"Encrypted and Hashed passwords are encrypted or hashed by default based on information supplied in the machineKey element in your configuration."
It means that theoretically you can encrypt (and store in the membership DB) your passwords with a custom application applying the encryption method (AES / 3DES / DES) specified at the machineKey, but I'm not sure whether it is a good idea.