Authenticating to Asp.Net Membership provider programmatically

Download Sample Visual Studio Solution

Scenario:

You have a web site or other http services that are secured via the ASP.Net Membership Provider and you want to access some of these resources from code – such as a class library or desktop application. Users of the web site obviously will be sent to a login page that takes their username and password and then authenticates the user. But how do you authenticate against the same Membership Provider when you are not using a web browser, and therfore cannot interact with a login page? Continue reading