Reputation: 223
I'm developing a website in mvc2, and i'm using the .net Authentication. How can i do to change my login authorization to use email and password.
thanks
Upvotes: 0
Views: 99
Reputation: 1038790
Inside your controller action which emits the authentication cookie just check if the mail matches the password and use the email as username for the authentication cookie:
[HttpPost]
public ActionResult Login(string email, string password)
{
// TODO: query your membership provider and verify if the given email
// matches the password and if they match emit the authentication cookie
// using the email as username
}
Upvotes: 1