Implement 389 DS's PBKDF2_SHA256 password scheme.
[lgpl/argeo-commons.git] / org.argeo.enterprise / src / org / argeo / osgi / useradmin / AggregatingUserAdmin.java
index 75ca9ae884605a81ac07a219455030e5f5990172..85a44708204312646d30b7db4f235599231957a3 100644 (file)
@@ -2,10 +2,8 @@ package org.argeo.osgi.useradmin;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -168,11 +166,21 @@ public class AggregatingUserAdmin implements UserAdmin {
                        return tokens;
                List<UserAdmin> res = new ArrayList<UserAdmin>(1);
                for (LdapName baseDn : businessRoles.keySet()) {
+                       AbstractUserDirectory ud = businessRoles.get(baseDn);
                        if (name.startsWith(baseDn)) {
-                               AbstractUserDirectory ud = businessRoles.get(baseDn);
                                if (!ud.isDisabled())
                                        res.add(ud);
                        }
+//                     Object principal = ud.getProperties().get(Context.SECURITY_PRINCIPAL);
+//                     if (principal != null) {
+//                             try {
+//                                     LdapName principalLdapName = new LdapName(principal.toString());
+//                                     if (principalLdapName.equals(name))
+//                                             res.add(ud);
+//                             } catch (InvalidNameException e) {
+//                                     // silent
+//                             }
+//                     }
                }
                if (res.size() == 0)
                        throw new UserDirectoryException("Cannot find user admin for " + name);
@@ -189,16 +197,16 @@ public class AggregatingUserAdmin implements UserAdmin {
                return tokensBaseDn != null && baseDn.equals(tokensBaseDn);
        }
 
-       protected Dictionary<String, Object> currentState() {
-               Dictionary<String, Object> res = new Hashtable<String, Object>();
-               // res.put(NodeConstants.CN, NodeConstants.DEFAULT);
-               for (LdapName name : businessRoles.keySet()) {
-                       AbstractUserDirectory userDirectory = businessRoles.get(name);
-                       String uri = UserAdminConf.propertiesAsUri(userDirectory.getProperties()).toString();
-                       res.put(uri, "");
-               }
-               return res;
-       }
+//     protected Dictionary<String, Object> currentState() {
+//             Dictionary<String, Object> res = new Hashtable<String, Object>();
+//             // res.put(NodeConstants.CN, NodeConstants.DEFAULT);
+//             for (LdapName name : businessRoles.keySet()) {
+//                     AbstractUserDirectory userDirectory = businessRoles.get(name);
+//                     String uri = UserAdminConf.propertiesAsUri(userDirectory.getProperties()).toString();
+//                     res.put(uri, "");
+//             }
+//             return res;
+//     }
 
        public void destroy() {
                for (LdapName name : businessRoles.keySet()) {