Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Only LDAP Connection Strings are Supported against Active Directory

I have the following ASP.NET Membership section defined in the Web.config file:

<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
  <providers>
    <clear/>
    <add connectionStringName="ADService" connectionUsername="umanage"
      connectionPassword="letmein" enablePasswordReset="true" enableSearchMethods="true"
      applicationName="uManage" clientSearchTimeout="30" serverSearchTimeout="30"
      name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</membership>

The Connection string looks like this:

<add name="ADService" connectionString="ldap://familynet.local" />

Whenever I call the following code:

Membership.GetAllUsers();

I get the following error:

Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Only LDAP connection strings are supported against Active Directory and ADAM.

I don't understand why the system is claiming the LDAP connection string is bad because it is in fact a valid LDAP string as specified by the MSDN documentation.

http://msdn.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx

Any ideas?

like image 717
Brent Pabst Avatar asked May 09 '10 16:05

Brent Pabst


1 Answers

Your LDAP connection string actually is NOT valid - LDAP connection strings are case-sensitive; the LDAP prefix must be uppercase. Use:

connectionString="LDAP://familynet.local" />

and you should be fine.

like image 162
marc_s Avatar answered Nov 04 '22 06:11

marc_s