I've read several posts about this (such as this one and this one describing a bug in the WebConfig) but none of them describing a full explanation on how to implement the LDAP authentication on MVC3. I've been doing it with Web Forms without any issues but in MVC my main issue at the moment is that the application never redirects to the my Authentication/Login controller/action.
Here's my WebConfig:
<connectionStrings>
<add name="ADConnectionString" connectionString="LDAP://blablabla.net"/>
</connectionStrings>
<authentication mode="Forms">
<forms loginUrl="~/Authentication/Login" timeout="100000" name="adAuthCookie" />
</authentication>
<membership defaultProvider="blablablaMembershipProvider">
<providers>
<add name="blablablaMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionProtection="Secure"
attributeMapUsername="sAMAccountName"
enableSearchMethods="false" />
</providers>
</membership>
I've also tried to use a simple Logon.aspx page that I've put in my Views folder and use routes.MapPageRoute but that didn't work either.
routes.MapPageRoute("ASPX", "Views", "~/Logon.aspx");
Many other sites also describe how to implement this but don't go further than the WebConfig configuration.
I would really appreciate any help on this!
Thanks