Login

How do I enable SQL Membership Provider for my site?

Versions: n/a, FAQ number: 209, Old FAQ number: 13946

There are two ways of doing this depending on if you want to change the provider on a development site or on a public manager installed site. 

1 - Enabling the provider in a development environment

 

If you are developing and deploying a site through Visual Studio you can use the ASP.NET Configuration tool.

  1. Click the button at the top of your solution view and the ASP.NET Configuration will be opened in a Web browser.
  2. Click the Provider tab and then click the Select different provider for each feature (advanced) link.
  3. Choose SqlMemberShipProvider and you are done.

See the SDK Documentation for further references on setting up providers for a site as well as a creating users and roles.

2 - Enabling the provider on a public site

 

You can enable the SqlMembershipProvider in the <system.web><roleManager> section of web.config.

  1. Open up the sites configuration file and scroll down to the appropriate section.
  2. Enter SqlServerMembershipProvider as default provider.

Excerpt from a web.config using the SqlMembershipProvider:

<system.web>

  <membership defaultProvider="SqlServerMembershipProvider" userIsOnlineTimeWindow="10">

    <providers>

      <clear />

      <add name="MultiplexingMembershipProvider"

           type="EPiServer.Security.MultiplexingMembershipProvider, EPiServer"

           provider1="SqlServerMembershipProvider"

           provider2="WindowsMembershipProvider" />

      <add name="WindowsMembershipProvider"

           type="EPiServer.Security.WindowsMembershipProvider, EPiServer"

           ...="" />

      <add name="SqlServerMembershipProvider"

           type="System.Web.Security.SqlMembershipProvider, System.Web,

                 Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

           ...=""

           ...=""

    </providers>

  </membership>

</system.web>


 

Note: If you do not have any registered members in your database you need to create a user with the ASP.NET configuration tool. Create a role for your user and add this to the location section of web.config, see the following example of a virtual role called LocalAdmin.

  <location path="UI/admin">

    <system.web>

      <authorization>

        <allow roles="WebAdmins, Administrators, LocalAdmin" />

        <deny users="*" />

      </authorization>

    </system.web>

  </location>

 

To log in with a windows account and create a user, complete the following steps:

  1. Enable MultiplexingProvider as default provider in web.config.
  2. Log in to EPiServer and create a user with the appropriate permissions.
EPiTrace logger