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. ...

Get Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.