How to log in and register via web api using membership. Using

Membership.ValidateUser(login, password) 

or

 WebSecurity.Login(login, password) 

for registration

 WebSecurity.CreateUserAndAccount(login, password) 

sometimes gives the following type error

 {"$id":"1","Message":"An error has occurred."}. 

But sometimes it works great. Or how can I compare passwords from the database and the password entered by the user?

  • Passwords are best stored as sha1 hash sums. then compare the hash sum of the entered password with the one in the database. maybe it won't hurt to add some salt :) - bmo

0