By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

Login using Active Directory Authentication in Windows Forms

P: n/a
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
Sep 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
"Finn Stampe Mikkelsen" <st****@city.dkwrote in message
news:e$****************@TK2MSFTNGP02.phx.gbl...
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

Sep 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.