Intranet - AD

I developed an Intranet site for my company for a year now. I have a login page which users credential store in SQL. Now I want to switch it to AD. I am using .net 3.5 and aspx. How should I go about doing something like this? I use session on username. How would this work when I use AD to authentication?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This link describes the process of authenticating via LDAP using asp.
Ricardo MartínezInformation SecurityCommented:
You need to change the authentication on the login page to check the credentials on the AD. Check this:
VBdotnet2005Author Commented:
I don't understand what _path is?

public LdapAuthentication(string path)
      _path = path;
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VBdotnet2005Author Commented:

I got the link to work.

I can get username below. I can type it in a login page, and it works perfectly. What if I don't want to type password ? Can I use Windowsidentiy to pass it in too?

dim id as windowsidentity = windowsidentity.getcurrent
dim username as string =    <<< username

Public Function AuthenticateUser(ByVal username As String, ByVal password As String) As Boolean
        Dim root As New DirectoryEntry("LDAP://RootDSE")
        Using root
            Dim dnc As String = root.Properties("defaultNamingContext")(0).ToString()
            Dim server As String = root.Properties("dnsHostName")(0).ToString()

            Dim adsPath As String = [String].Format("LDAP://{0}/{1}", server, dnc)
            Dim authentic As Boolean = False
            Dim entry As New DirectoryEntry(adsPath, username, password)
                Dim nativeObject As Object = entry.NativeObject
                authentic = True
            Catch dsce As DirectoryServicesCOMException
                Return False
            End Try
        End Using
        Return True
    End Function
WindowsIdentity.GetCurrentUser will give you the account under which is running.

So if you are not using WindowsAuthenticaiton+Impersonation, it is not going to return the actual user most likely NT Authority\Network Service. And if you have Windows Authentication On then I don't see a use of doing LDAP authentication.

Check this for more info:

Not sure if you are looking for something like this:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.