简体   繁体   中英

Active Directory Membership Provider with AD LDS

I am trying to create web app that is using ActiveDirectoryMembership with AD LDS When I try to register a new user, or login with existing user, I am getting this error "If either of the properties connection-username or connection-password is specified, the other must also be specified" And I am getting a similar error when I am trying to use "ASP.NET configuration" My web.config looks like this, and as you can see I am providing both the username and password:

<connectionStrings>
    <add name="ADService" connectionString="LDAP://localhost:5000/OU=Users,O=TestDirectory"/>
  </connectionStrings>

  <system.web>

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" defaultUrl="default.aspx"/>
    </authentication>


    <membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
      <providers>
        <add name="AspNetActiveDirectoryMembershipProvider" 
    connectionStringName="ADService" 
    connectionUserName="CN=ADAMAdmin,OU=Users,O=TestDirectory" connectionPassword="admin"
             type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
             connectionProtection="None"/>
      </providers>
    </membership>

Typically username is in the format Domain\\Username.

Additionally the property is connectionUsername not connectionUserName (note the lowercase n).

The attributes are case-sensitive. Try 'connectionUsername' instead of 'connectionUserName'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM