From 977a120eb36c5ddaa41ddabadd1f546bce10cfce Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 09 Sep 2011 10:16:46 +0000
Subject: [PATCH] Issue OPENDJ-262: Implement pass through authentication (PTA)

---
 opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java b/opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
index 3412387..2f23376 100644
--- a/opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
+++ b/opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -290,7 +290,7 @@
           new SearchRequestProtocolOp(
             ByteString.valueOf(baseDN.toString()), scope,
             DereferencePolicy.DEREF_ALWAYS, 1 /* size limit */,
-            (timeoutMS / 1000), false /* types only */,
+            (timeoutMS / 1000), true /* types only */,
             RawFilter.create(filter), NO_ATTRIBUTES);
         sendRequest(searchRequest);
 
@@ -310,7 +310,7 @@
           case OP_TYPE_SEARCH_RESULT_ENTRY:
             final SearchResultEntryProtocolOp searchEntry = responseMessage
                 .getSearchResultEntryProtocolOp();
-            if (username != null)
+            if (username == null)
             {
               username = ByteString.valueOf(searchEntry.getDN().toString());
             }
@@ -343,13 +343,6 @@
                       String.valueOf(options.dn()), String.valueOf(baseDN),
                       String.valueOf(filter)));
 
-            case TIME_LIMIT_EXCEEDED:
-              // The server timed out the search.
-              throw new DirectoryException(ResultCode.CLIENT_SIDE_TIMEOUT,
-                  ERR_LDAP_PTA_CONNECTION_SEARCH_TIME_LIMIT.get(host, port,
-                      String.valueOf(options.dn()), String.valueOf(baseDN),
-                      String.valueOf(filter)));
-
             default:
               // The search failed for some reason.
               throw new DirectoryException(resultCode,
@@ -1712,8 +1705,10 @@
   // Debug tracer for this class.
   private static final DebugTracer TRACER = DebugLogger.getTracer();
 
-  // Attribute list for searches requesting no attributes.
-  private static final LinkedHashSet<String> NO_ATTRIBUTES;
+  /**
+   * Attribute list for searches requesting no attributes.
+   */
+  static final LinkedHashSet<String> NO_ATTRIBUTES;
 
   static
   {
@@ -1761,6 +1756,7 @@
     case OTHER:
     case UNWILLING_TO_PERFORM:
     case OPERATIONS_ERROR:
+    case TIME_LIMIT_EXCEEDED:
     case CLIENT_SIDE_CONNECT_ERROR:
     case CLIENT_SIDE_DECODING_ERROR:
     case CLIENT_SIDE_ENCODING_ERROR:

--
Gitblit v1.10.0