Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to tell ASP.NET application what Active Directory to use?
    primarykey
    data
    text
    <p>IIS Configuration:</p> <pre><code>Anonymous Authentication Enabled ASP.NET Impersonation Enabled Windows Authentication Enabled *the rest is disabled </code></pre> <p>Web.Config:</p> <pre><code>&lt;add name="ADConn" connectionString="LDAP://192.168.0.21" /&gt; . . . &lt;authentication mode="Windows" /&gt; &lt;authorization&gt; &lt;allow users="*"/&gt; &lt;deny users="?" /&gt; &lt;/authorization&gt; &lt;roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/&gt; &lt;identity impersonate="true"/&gt; &lt;membership defaultProvider="ADMembership"&gt; &lt;providers&gt; &lt;add name="ADMembership" type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ADConn" connectionUsername="dominic" attributeMapUsername="sAMAccountName" connectionPassword="p@ssw0rd" /&gt; &lt;/providers&gt; &lt;/membership&gt; </code></pre> <p>And in my web application:</p> <pre><code>[Authorize] public class HomeController : Controller { </code></pre> <p>I'm trying to convert my application from Form to Windows Authentication. With this configuration, the page prompts me with login dialog. When I use my AD account, I can't login, but when I use my local account, I can visit the page. Why? How would I tell my application to use a specific AD? Is my configuration correct?</p> <p>Important notes:</p> <ul> <li>My IIS and AD are on different machines and they are not on the same domain. </li> <li>My IIS and client is on the same machine. </li> <li>My application works with Form Authentication using AD.</li> <li>IIS version: 6.1</li> <li>MVC version: 4</li> <li>AD OS: Windows 2008</li> <li>Client and IIS OS: Windows 7</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload