Authenticate Domino Directory user through an ASP.NET page

G

gabriel.salama

I am desperately trying to create a login page in ASP.NET in which a
user can be authenticated against a Domino Directory but for the life
of me, I cannot even find anything remotely close to this on the
internet. It's like nobody has ever needed to do this.

I already did it in a ColdFusion page and I'm amazed at how incredibly
easy it was using the CFLDAP tag. I would have thought that a task like
this would have been equally easy in ASP.NET.

Can anyone shed some light on this?.... please???

I really got sick of hitting walls with this so I decided to post. I
apologize in advance if I posted to the wrong group.

Thanks!
 
J

Joe Kaplan \(MVP - ADSI\)

..NET has two LDAP stacks to play with, System.DirectoryServices and
System.DirectoryServices.Protocols (in .NET 2.0). S.DS.P is a low level,
pure LDAP API, while S.DS uses ADSI under the hood.

Essentially, you just need to do a bind in order to authenticate a user. In
S.DS, that would generally look like:

bool authenticated;
DirectoryEntry entry = new
DirectoryEntry("LDAP://yourdominoserver.com/rootDSE","user","password",AuthenticationTypes.None);
try
{
object o = entry.NativeObject;
authenticated = true;
}
catch (COMException ex)
{
authenticated = false;
{
finally
entry.Dispose();


The trick is getting the object you want to use correct (rootDSE should be
ok if Domino supprts LDAP V3) and the username right. You also want to
prevalidate for null passwords since simple bind with null password is
supposed to succeed.

If you want to use S.DS.P, the syntax is a little different, but the idea is
the same.

Note that the above code is not secure because it passes the plain text
credentials on the network. Ideally your domino LDAP server would support
SSL so that you could use the SecureSocketsLayer flag.

HTH,

Joe K.
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top