1

I have to create a site that uses the active directory from another server to auth the user. First my page should try to auth the user automatically with his windows login and if this haven´t success it should ask him with a form for username/pw.

This is what i have so far in my Web.config, just a few code snippets. The web wasen´t as helpful as i hoped :-(

<connectionStrings>
  <add name="ADConnectionString" connectionString="LDAP://testdomain.test.com/CN=Users,DC=testdomain,DC=test,DC=com" />
</connectionStrings>

<membership defaultProvider="MyADMembershipProvider">
  <providers>
    <add
       name="MyADMembershipProvider"
       type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
       connectionStringName="ADConnectionString"
       connectionUsername="testdomain\administrator"
       connectionPassword="password"/>
  </providers>
</membership>

<system.web>

  <authentication mode="Windows" />

  <authorization>
    <deny users="?"/>
  </authorization>

</system.web>
1
  • If a user is not in AD, what membership provider is used? You also should consider your RoleManager as well, since the same issues regarding multiple providers will apply to roles. Commented Oct 20, 2011 at 16:31

1 Answer 1

1

There is a very good article on mixing two authentication schemes here. Also see related question here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.