1

I have my config setup like below:

<configuration>
  <connectionStrings>
    <add name="ADConnectionString" connectionString="LDAP://myldap/CN=Users,DC=nevco,DC=local"/>
  </connectionStrings>
<system.web>
<authentication mode="Forms">
  <forms name=".ADAuthCookie" timeout="10" loginUrl="Login.aspx" defaultUrl="Default.aspx" />
</authentication>
    <membership defaultProvider="DomainLoginMembershipProvider">
      <providers>
        <clear/>
        <add name="DomainLoginMembershipProvider"
             type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="ADConnectionString" attributeMapUsername="sAMAccountName" />
      </providers>
     </membership>
  </system.web>
</configuration>

I can attempt to log on but every time it says I am using the incorrect username/password. Does it look like I am doing anything wrong above? Is there any way for me to find more information on why it's not finding my username/pass?

UPDATE:

Do I need to provide a Username and Password in my membership/providers section?

2
  • 1
    What happens if you use LDAP://myldap/ Commented Nov 23, 2010 at 18:25
  • 1
    It errors out with The specified connection string does not represent a valid LDAP adspath. Commented Nov 23, 2010 at 21:57

2 Answers 2

1

Ok, I ended up using an LDAP browser to examine the structure. After a little fudging around I changed my LDAP url to this:

LDAP://myldap/DC=nevco,DC=local

And it started working. Hope this helps someone!

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

Comments

0

Why make the user login in at all?

Try this provider

<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" />

you can then do something to see if they are authorized Roles.

Roles.IsUserInRole("someGroupInAd")

Your web site would have to be setup with Integrated Windows Authentication in IIS

2 Comments

So this would use whatever windows account they are signed in with to access the site? What if they were accessing form their home machine?
This would work if someone was connected to the domain. Like an intranet site. It probably won't work as a public facing website as you would have to have to setup the website to use anonymous access.

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.