Login using Active Directory Authentication in Windows Forms

  • Thread starter Thread starter Finn Stampe Mikkelsen
  • Start date Start date
F

Finn Stampe Mikkelsen

Hi

I'm coding a project, that needs to authenticate the user on a remote
servers active diretctory... The program should be able to lookup the user
in the servers AD, authenticate the user og deny access. depending on the
authentication the code should either go on or exit..

Could somebody help me in this regard, either code-snipplet or reference to
usefull site on the net...??

/Finn

--
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary ant those who
don't.
Es gibt 10 arten von menschen. Die die binär verstehen bzw. die die es nicht
tuhen
 
Problem solved using DirectoryServices and LDAP.

AuthenticateUser(Path, User, Pass)

Path="LDAP://server.com

User/Pass is the user to be authenticated. Simple true/false app

/Finn


Function AuthenticateUser(ByVal path As String, ByVal user As String, ByVal
pass As String) As Boolean

Dim dirEntry As New System.DirectoryServices.DirectoryEntry(path, user,
pass)

'Dim dirEntry As New DirectoryEntry(path, user, pass)

Try

Dim nat As Object

'if the NativeObject can be created using those credentials

'then they are valid.

nat = dirEntry.NativeObject

Return True

Catch

Return False

End Try

End Function






--
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary ant those who
don't.
Es gibt 10 arten von menschen. Die die binär verstehen bzw. die die es nicht
tuhen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top