Authenticating a user under a given suffix without using his DN
-
15 maja 2012 19:51
Good afternoon,
I'm still struggling with LDAP authentication. I have a Directory Server (Oracle DSEE 7) with two suffixes (say, o=test1 and o=test2) . I have users under both suffixes.
Say I wanted to authenticate a user under test1 (dn: uid=grajea01,ou=people,o=test1), the following code would work if I'd use the whole DN, but not when using only the uid.
What I'd want is to be able to pass o=test1 as a parameter somewhere so I'd only need the uid, not the whole user dn.
Here's the code I'm using and that works with the whole dn (below) . The creds structure contains the server's IP address, port number, username (user's dn), and password. Instead of passing
uid=grajea01,ou=people,o=test1, I'd like to simply use uid=grajea01 and that the connection be established while using o=test1. Any help would be appreciated !
-- Jeff
NetworkCredential nc =new NetworkCredential(creds.UID, creds.Passwd); LdapConnection conn =new LdapConnection(new LdapDirectoryIdentifier(creds.Host, creds.Port, false, false)); conn.AuthType =AuthType.Basic; conn.Credential = nc; conn.SessionOptions.ProtocolVersion =3;
try { conn.Bind(); }
-EDIT-
To be a bit more clear on what I'd like:
Instead of passing creds.UID="uid=grajea01,ou=people,o=test1") to my method, I'd pass creds.UID="grajea01" and creds.host="DS-server/o=test1/", creds.port="389", or something similar.
thanks
- Zmodyfikowany przez Jeff Gratton 15 maja 2012 21:09 More precise
- Przeniesiony przez Mike FengMicrosoft Contingent Staff 16 maja 2012 11:23 Look for appropriate forum (From:.NET Base Class Library)
Wszystkie odpowiedzi
-
16 maja 2012 11:23
Hi Jeff,
Based my understanding, your issue is more related to Active Directory, and this forum is not for this topic, I have moved this thread to the "Where is the forum for" forum to look for a appropriate forum.
Thank you for your understanding and support.
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
18 maja 2012 07:22Właściciel
- Zaproponowany jako odpowiedź przez Ed Price - MSFTMicrosoft Employee, Owner 18 maja 2012 07:22
- Oznaczony jako odpowiedź przez Ed Price - MSFTMicrosoft Employee, Owner 28 maja 2012 17:14
-
18 maja 2012 19:15
You are right, Mike, my apologies.
-- Jeff