incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1094993 - in /incubator/lcf/trunk: ./ connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/
Date Tue, 19 Apr 2011 10:17:59 GMT
Author: kwright
Date: Tue Apr 19 10:17:58 2011
New Revision: 1094993

URL: http://svn.apache.org/viewvc?rev=1094993&view=rev
Log:
Fix for CONNECTORS-183.  Add a text field to the Active Directory authority's configuration
tabs to permit protocol selection.

Modified:
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
    incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryConfig.java

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1094993&r1=1094992&r2=1094993&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Tue Apr 19 10:17:58 2011
@@ -2,6 +2,11 @@ ManifoldCF Change Log
 $Id$
 
 ======================= 0.3-dev =========================
+
+CONNECTORS-183: Add a text field to make Active Directory authority
+configuration more flexible with regards to protocol.
+(Shinichiro Abe, Karl Wright)
+
 CONNECTORS-32: Add access token caching to the Active Directory
 authority connector, LiveLink authority connector, Meridio authority
 connector, and Documentum authority connector.

Modified: incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java?rev=1094993&r1=1094992&r2=1094993&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
(original)
+++ incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
Tue Apr 19 10:17:58 2011
@@ -44,6 +44,7 @@ public class ActiveDirectoryAuthority ex
   private String domainControllerName = null;
   private String userName = null;
   private String password = null;
+  private String authentication = null;
 
   /** Cache manager. */
   private ICacheManager cacheManager = null;
@@ -98,6 +99,7 @@ public class ActiveDirectoryAuthority ex
     domainControllerName = configParams.getParameter(ActiveDirectoryConfig.PARAM_DOMAINCONTROLLER);
     userName = configParams.getParameter(ActiveDirectoryConfig.PARAM_USERNAME);
     password = configParams.getObfuscatedParameter(ActiveDirectoryConfig.PARAM_PASSWORD);
+    authentication = configParams.getParameter(ActiveDirectoryConfig.PARAM_AUTHENTICATION);
   }
 
   // All methods below this line will ONLY be called if a connect() call succeeded
@@ -149,6 +151,7 @@ public class ActiveDirectoryAuthority ex
     domainControllerName = null;
     userName = null;
     password = null;
+    authentication = null;
     super.disconnect();
   }
 
@@ -331,6 +334,13 @@ public class ActiveDirectoryAuthority ex
 "    editconnection.username.focus();\n"+
 "    return false;\n"+
 "  }\n"+
+"  if (editconnection.authentication.value == \"\")\n"+
+"  {\n"+
+"    alert(\"Authentication cannot be null\");\n"+
+"    SelectTab(\"Domain Controller\");\n"+
+"    editconnection.authentication.focus();\n"+
+"    return false;\n"+
+"  }\n"+
 "  return true;\n"+
 "}\n"+
 "\n"+
@@ -360,7 +370,10 @@ public class ActiveDirectoryAuthority ex
     String password = parameters.getObfuscatedParameter(org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_PASSWORD);
     if (password == null)
       password = "";
-
+    String authentication = parameters.getParameter(org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_AUTHENTICATION);
+    if (authentication == null)
+    	authentication = "DIGEST-MD5 GSSAPI";
+    
     // The "Domain Controller" tab
     if (tabName.equals("Domain Controller"))
     {
@@ -379,6 +392,10 @@ public class ActiveDirectoryAuthority ex
 "    <td class=\"description\"><nobr>Administrative password:</nobr></td>\n"+
 "    <td class=\"value\"><input type=\"password\" size=\"32\" name=\"password\"
value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/></td>\n"+
 "  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Authentication:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"32\" name=\"authentication\"
value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(authentication)+"\"/></td>\n"+
+"  </tr>\n"+
 "</table>\n"
       );
     }
@@ -388,7 +405,8 @@ public class ActiveDirectoryAuthority ex
       out.print(
 "<input type=\"hidden\" name=\"domaincontrollername\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(domainControllerName)+"\"/>\n"+
 "<input type=\"hidden\" name=\"username\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(userName)+"\"/>\n"+
-"<input type=\"hidden\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/>\n"
+"<input type=\"hidden\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/>\n"+
+"<input type=\"hidden\" name=\"authentication\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(authentication)+"\"/>\n"
       );
     }
   }
@@ -414,6 +432,9 @@ public class ActiveDirectoryAuthority ex
     String password = variableContext.getParameter("password");
     if (password != null)
       parameters.setObfuscatedParameter(org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_PASSWORD,password);
+    String authentication = variableContext.getParameter("authentication");
+    if (authentication != null)
+      parameters.setParameter(org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_AUTHENTICATION,authentication);
     return null;
   }
   
@@ -477,7 +498,7 @@ public class ActiveDirectoryAuthority ex
       
       Hashtable env = new Hashtable();
       env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
-      env.put(Context.SECURITY_AUTHENTICATION,"DIGEST-MD5 GSSAPI");
+      env.put(Context.SECURITY_AUTHENTICATION,authentication);      
       env.put(Context.SECURITY_PRINCIPAL,userName);
       env.put(Context.SECURITY_CREDENTIALS,password);
 				

Modified: incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryConfig.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryConfig.java?rev=1094993&r1=1094992&r2=1094993&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryConfig.java
(original)
+++ incubator/lcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryConfig.java
Tue Apr 19 10:17:58 2011
@@ -33,6 +33,8 @@ public class ActiveDirectoryConfig
   public static final String PARAM_USERNAME = "User name";
   /** Administrative password */
   public static final String PARAM_PASSWORD = "Password";
+  /** Authentication */
+  public static final String PARAM_AUTHENTICATION = "Authentication";
 
 
 }



Mime
View raw message