How do I migrate users from a existing users table to Forms Authentication?
There seems to be three options:
-
T-SQL – Iterate through the existing users table and insert into Forms Authentication tables using the stored procedure aspnet_Membership_CreateUser
-
Code – create a utility that will iterate through the existing users table and insert into Forms Authentication tables using Membership.CreateUser()
-
Code – as users login verify credentials against existing users table and insert into Forms Authentication tables using Membership.CreateUser()
Which is the most practical?
I have been currently trying option 1 but I am running into difficulties using the password salt to create the encrypted password from a plain text password
With regard to #1, what exactly is the problem? You don’t need to worry about the hashing if you’ve got plaintext passwords already. Just call CreateUser(username, password). Simple as that.