Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bruno 30 posts 50 karma points
    Apr 01, 2011 @ 22:16
    Bruno
    0

    How to add more than one active directory domain to authenticate users?

    The company that I work for has multiple Active Directory domains that users authenticate against. For example user1 from domain xxx has to login: xxx\user1, user1 from domain yyy has to login: yyy\user2, and user3 from domain zzz has to login zzz\user3. How to I configure my web.config to support this?

     

    Below is my current connection string. 

    <connectionStrings>
        <add name="ADConnectionString" connectionString="LDAP://pm01dom0001.xx.yyy.zzz/DC=xxx,DC=yyy,DC=zzz" />   
      </connectionStrings>

     

    Thanks!

  • Bruno 30 posts 50 karma points
    Apr 01, 2011 @ 22:28
    Bruno
    0

    http://msdn.microsoft.com/en-us/library/ff650307.aspx#paght000021_step3

    <connectionStrings>
      <add name="TestDomain1ConnectionString" connectionString="LDAP://testdomain1.test.com/CN=Users,DC=testdomain1,DC=test,DC=com" />
      <add name="TestDomain2ConnectionString" connectionString="LDAP://testdomain2.test.com/CN=Users,DC=testdomain2,DC=test,DC=com" />
      <add name="TestDomain3ConnectionString" connectionString="LDAP://testdomain3.test.com/CN=Users,DC=testdomain3,DC=test,DC=com" />
    
    </connectionStrings>

     

    <membership >
      <providers>
        <add
          name="TestDomain1ADMembershipProvider"
          type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, 
                Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="TestDomain1ConnectionString"
          connectionUsername="testdomain1\administrator" 
          connectionPassword="password"/>
        <add
          name="TestDomain2ADMembershipProvider"
          type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, 
                Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="TestDomain2ConnectionString"  
          connectionUsername="testdomain2\administrator" 
          connectionPassword="password"/>
          <add
            name="TestDomain3ADMembershipProvider"
            type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, 
                Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
            connectionStringName="TestDomain3ConnectionString"
            connectionUsername="testdomain3\administrator" 
            connectionPassword="password"/>
      </providers>
    </membership>
  • Chris Lord 58 posts 211 karma points
    Aug 24, 2011 @ 14:15
    Chris Lord
    0

    Hi Bruno,

    Is this the solution for this, I need to do the same thing, authenticate users from multiple AD domains, does the above examples work?

    Cheers

    Chris

  • Bruno 30 posts 50 karma points
    Aug 24, 2011 @ 14:39
    Bruno
    0

    Hi Chris,

    In the end I did not implement this, but it should work with a few tweaks.(I ended up using Liferay.)

    For example, on the login screen you could have a drop-down box with all your company's domains and depending on what they select you use the corresponding membership provider.

Please Sign in or register to post replies

Write your reply to:

Draft