Tuesday, July 8, 2008

Configuring the Membership API

The Membership API needs a database where to store it's information. We can create it's tables and stored procedures within our own website's database, by running the aspnet_regsql.exe utility.

We then need to point the Membership API to our database. This is done through the following web configuration :

<configuration>
<system.web>
<membership defaultProvider="MembershipProvider">
<providers>
<add name="MembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="" applicationName="" />
</providers>
</membership>

The connectionStringName must be defined in the <connectionStrings> section of the configuration file, while the applicationName must be set in order to prevent deployment issues. Also, if we intend to use the Roles functionality, we need to configure it in a similar way, through the roleManager configuration element.

No comments: