José Silva
José Silva

Reputation: 223

.Net Forms Authentication

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

Answers (1)

Darin Dimitrov
Darin Dimitrov

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

Related Questions