O'Reilly logo

Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB by Stefan Schackow, Bilal Haidar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.2. Provider Configuration

If you configure the provider with the minimum number of required configuration attributes, most of its functionality will work against existing AD installations. About all you need to get up and running is a provider definition and a valid connection string:

<connectionStrings>
     <add name="adconnection" connectionString="LDAP://mydomain.dns.name"/>
</connectionStrings>

<membership defaultProvider=" someprovider ">
  <providers>
    <clear/>
    <add name="someprovider"
         type="System.Web.Security.ActiveDirectoryMembershipProvider, _"
         connectionStringName="adconnection" />
  </providers>
</membership>

It is pretty much guaranteed that for production applications, though, you will need to delve a little more deeply into the provider's configuration. The section "Working with Active Directory" walks you through a number of the common configuration tasks for setting up the provider.

For now, take a look at the various configuration settings that are available in the <add /> element of the provider. The available settings fall into the following general groups:

  • Directory connection settings

  • Schema mappings

  • Search-specific settings

  • Membership provider settings

13.2.1. Directory Connection Settings

As with SQL provider, you need to at least supply a connection string so that the provider knows where it should read and write data. However, unlike SQL Server connection strings, there is no such thing as specifying explicit connection credentials inside of the connection string. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required