473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Login using Active Directory Authentication in Windows Forms

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
1 6256
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: anonymous | last post by:
Hi all, I've been searching the way to achieve the following task. But no luck so far. I have a web site(main site), which requires authentication. This authentication is set at Windows...
11
by: David W. Simmonds | last post by:
I have a form that will prompt for a user name/password. In VS.NET, I have the protected form in a folder named Admin. I have a Web.config file in that folder as well. It contains the following...
1
by: Christopher | last post by:
We are using forms authentication in our web app and typically query our LDAP Servers by binding to the user node in the LDAP Tree. We usually see the following DN used as the DN for each user.....
2
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public...
9
by: dana lees | last post by:
Hello, I am developing a C# asp.net application. I am using the authentication and authorization mechanism, which its timeout is set to 60 minutes. My application consists of 2 frames - a...
0
by: Daniel Knöpfel | last post by:
Hello On our asp.net 2.0 website we impersonate every request to the identity of the user logged in. This works this way: 1. user logs in, providing username, password 2. user is authenticated...
6
by: Kat | last post by:
Every time I attempt to run a localhost website, it asks me for a login, as if I am not a user on the local machine. I am a user on the local machine, I am an admin on the local machine. I am not...
6
by: =?Utf-8?B?U2hlcnJp?= | last post by:
I know this question has been posted in many places, but I have not been able to solve our current problem. The developers in my office are all new to C#.net. We have been developing an...
1
by: Billy | last post by:
Hi I have an asp.net 2.0 website running with Windows integrated security and want users to be able to login using a formular on the website instead of the standard windows login prompt. All...
2
by: SF | last post by:
Hi, I am nes to ASP.NET. I try to develop on online form for my office that requiore use to login using Windows Authentication (Use name active directory). I am search to web and could not found...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.