I wish to use an SQL database that it already in use on my network, so I have written code to override ValidateUser()
:
public override bool ValidateUser(string username, string password)
{
return true;
}
I've set this so that it returns true, without checking my database for now, just to test the theory of it.
Is that all I need to do, or is there more to do so that it works properly with the other functions, like storing the username information so that it can be retrieved later on, or do I simply store this information in a session variable?
Once this function returns true, it the user effectively authenticated?
You don't need to override or implement all of the methods if you already inherit from
SqlmembershipProvider
.If you want to override
ValidateUser
(for example to log invalid login attempts), you don't need to store the user manually(he's stored in DB and identified via cookie) and can be retrieved byMembership.GetUser
.For example: