I have created a BasicMembershipProvider class that inherits from MembershipProvider, when implemented, the ValidateUser does not get called. This is my setup:
web.config
<membership defaultProvider="BasicMembershipProvider">
<providers>
<clear/>
<add name="BasicMembershipProvider" type="MyMVCProject.Providers.BasicMembershipProvider"/>
</providers>
</membership>
BasicMembershipProvider.cs
public class BasicMembershipProvider : MembershipProvider
{
//THIS FUNCTION NEVER GETS CALLED
public override bool ValidateUser(string email, string password)
{
//Do custom checks.
}
}
Controller
FormsAuthentication.Authenticate(model.Email, model.Password)
Is this the way to go about overriding the MembershipProvider with my own membership logic? If so, why doesn't the overidden function ValidateUser
gets called whenever I call FormsAuthentication.Authenticate()
?