I'm having trouble getting AD authentication working on my website. I have the following test code that works fine :
DirectoryEntry entry = new DirectoryEntry(srvr, usr, pwd);
object nativeObject = entry.NativeObject;
On my website I get an error "Your login attempt was not successful. Please try again.". I really haven't been able to figure out what's the underlying error in the process that prevents the login.
Here are the sections in my web.config :
<authentication mode="Forms">
<forms loginUrl="Default.aspx"
timeout="30"
name=".ADAuthCookie"
path="/"
requireSSL="false"
slidingExpiration="true"
defaultUrl="Edit.aspx"
cookieless="UseCookies"
enableCrossAppRedirects="false"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<membership defaultProvider="MyADMembershipProvider">
<providers>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADAuthConnection"
applicationName="/"
connectionProtection="Secure"
enableSearchMethods="true"
connectionUsername="company\usr"
connectionPassword="pwd"/>
</providers>
</membership>
Shouldn't this be all that is required? I don't plan to use profile so I haven't configured ProfileProvider, could this cause the problems?
Thanks for help!