We have had success using the ADODB LDAP driver from .NET. Use the
OleDb* set of objects. E.g.

OleDbConnection cxn = new OleDbConnection(
        string.Format("Provider=ADsDSOObject;Password={0};User ID={1}",
                password,
                username));

If all you want to do is authenticate, you'd have to read some nonsense
data using this command (forcing it to bind) and catch an exception to
indicate the bind failed.

Sebastian Good
Palladium Consulting
http://www.palladiumconsulting.com/

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin Hector
Sent: Thursday, March 25, 2004 5:24 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] LDAP Authentication to a non-Microsoft
server

Mark

You will need to write your own code to perform the authentication
against
the directory. I have done this in the past using the C LDAP API wrapped
in
a C++ COM object. The LDAP server was a Lotus notes server of which I
actually know very little. I tried to migrate the code to .NET but the
server was not configured to LDAP standard so would fail (never worked
out
why the C LDAP API implementation would work but the ADSI implementation
would not).

Basically you will need to use the System.DirectoryServices namespace
[1]
using the LDAP provider. In the C LDAP API the process was:

1. Perform an anonymous bind to the server
2. Search the directory (in my case, using the cn attribute)
3. If the entry is found, attempt an authenticated bind to the directory
(in
my case, using the cn and password)

Sorry I can't really help with the .NET side of things, but I seem to
remember the DirectoryServices namespace was quite self explanatory.
IIRC,
its just a managed wrapper onto ADSI.

You would be able to use forms authentication since at its most basic
your
authentication method will just accept a username and password and
return a
bool indicating the result, which is no different to storing a username
and
password in a database or elsewhere.

Hopefully someone else on this list will be more helpful!

KH

[1]
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDirectoryS
ervices.asp

_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection
http://www.msn.co.uk/specials/btbroadband

===================================
This list is hosted by DevelopMentorR  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to