You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2015/06/28 21:30:52 UTC

svn commit: r1688044 - /manifoldcf/branches/CONNECTORS-1131/framework/core/src/main/java/org/apache/manifoldcf/core/auth/LdapAuthenticator.java

Author: kwright
Date: Sun Jun 28 19:30:52 2015
New Revision: 1688044

URL: http://svn.apache.org/r1688044
Log:
Pick up all attributes from the right place

Modified:
    manifoldcf/branches/CONNECTORS-1131/framework/core/src/main/java/org/apache/manifoldcf/core/auth/LdapAuthenticator.java

Modified: manifoldcf/branches/CONNECTORS-1131/framework/core/src/main/java/org/apache/manifoldcf/core/auth/LdapAuthenticator.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1131/framework/core/src/main/java/org/apache/manifoldcf/core/auth/LdapAuthenticator.java?rev=1688044&r1=1688043&r2=1688044&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1131/framework/core/src/main/java/org/apache/manifoldcf/core/auth/LdapAuthenticator.java (original)
+++ manifoldcf/branches/CONNECTORS-1131/framework/core/src/main/java/org/apache/manifoldcf/core/auth/LdapAuthenticator.java Sun Jun 28 19:30:52 2015
@@ -47,11 +47,19 @@ public class LdapAuthenticator implement
   private static final String SEARCH_ATTRIBUTE = "org.apache.manifoldcf.login.ldap.searchattribute";
 
   protected final String securityPrincipal;
+  protected final String securityAuthenticationType;
+  protected final String providerURLProperty;
+  protected final String contextSearchQuery;
+  protected final String searchAttribute;
   
   /** Constructor */
   public LdapAuthenticator(final IThreadContext threadContext)
     throws ManifoldCFException {
-    securityPrincipal = LockManagerFactory.getStringProperty(threadContext,SECURITY_PRINCIPLE,"admin");
+    securityPrincipal = LockManagerFactory.getStringProperty(threadContext,SECURITY_PRINCIPLE,"???");
+    securityAuthenticationType = LockManagerFactory.getStringProperty(threadContext,SECURITY_AUTHENTICATION_TYPE,"???");
+    providerURLProperty = LockManagerFactory.getStringProperty(threadContext,PROVIDER_URL_PROPERTY,"???");
+    contextSearchQuery = LockManagerFactory.getStringProperty(threadContext,CONTEXT_SEARCH_QUERY,"???");
+    searchAttribute = LockManagerFactory.getStringProperty(threadContext,SEARCH_ATTRIBUTE,"???");
   }
   
   /**
@@ -67,10 +75,10 @@ public class LdapAuthenticator implement
     environment.put(Context.INITIAL_CONTEXT_FACTORY, CONTEXT_FACTORY);
 
     environment.put(Context.PROVIDER_URL,
-        ManifoldCF.getProperty(PROVIDER_URL_PROPERTY));
+        providerURLProperty);
 
     environment.put(Context.SECURITY_AUTHENTICATION,
-        ManifoldCF.getProperty(SECURITY_AUTHENTICATION_TYPE));
+        securityAuthenticationType);
     environment.put(
         Context.SECURITY_PRINCIPAL,
         substituteUser(securityPrincipal, userID));
@@ -117,8 +125,7 @@ public class LdapAuthenticator implement
 
           results = ctx
               .search("",
-                  substituteUser(ManifoldCF
-                      .getProperty(CONTEXT_SEARCH_QUERY),
+                  substituteUser(contextSearchQuery,
                       userId), controls);
           // is the user in the group?
           while (results.hasMore()) {
@@ -126,7 +133,7 @@ public class LdapAuthenticator implement
                 .next();
 
             if (userId.equals(searchResult.getAttributes()
-                .get(ManifoldCF.getProperty(SEARCH_ATTRIBUTE))
+                .get(searchAttribute)
                 .get())) {
 
               Logging.misc.info("Successfully authenticated : "