Advertisement

12.02.2008 at 08:48AM PST, ID: 23950273 | Points: 500
[x]
Attachment Details

LdapConnection caches the user credentials

Asked by mmarinov in .NET, Lightweight Directory Access Protocol (LDAP), Microsoft Visual C#.Net

Tags: , , ,

Hi guys,

I have the following scenario. One ActiveDirectory server and one PC in the domain. From this PC I'm starting the following code:
LdapConnection connection = null;

         try {
            LdapDirectoryIdentifier identifier = new LdapDirectoryIdentifier(adServer, true, false);
            NetworkCredential credential = new NetworkCredential(username, password);

            using (connection = new LdapConnection(identifier, credential, AuthType.Basic)) {
               connection.Bind(credential);
               Console.WriteLine(connection.SessionOptions.HostReachable);
            }
         } catch (Exception ex) {
            Console.WriteLine(ex);
         }

The problem I have: If I use as 'password' either an active password or a password that was previously active, connection.SessionOptions.HostReachable returns always true. After some time (or restart, I'm not sure) after first call with the invalid password - I get false. Then after if I call the ldap with valid (active) password the original (problem) behavior come again.

I think that this is some kind of cache. I've tried all properties of LdapConnection, LdapConnection.SessionOptions but I'm not able to connect to the AD only with the active(valid) password.

Do you know how I can fix this problem?

ThanksStart Free Trial
[+][-]12.09.2008 at 01:06PM PST, ID: 23133716

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.10.2008 at 05:05AM PST, ID: 23138432

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.10.2008 at 05:07AM PST, ID: 23138442

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.10.2008 at 05:16AM PST, ID: 23138524

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.11.2008 at 08:35AM PST, ID: 23149779

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.11.2008 at 01:27PM PST, ID: 23152512

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080924-EE-VQP-38 - Hierarchy / EE_QW_2_20070628