+
+
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected AbstractUserDirectory scope(User user) {
+ Dictionary<String, Object> credentials = user.getCredentials();
+ // FIXME use arrays
+ Object usernameObj = credentials.get(SHARED_STATE_USERNAME);
+ Object passwordObj = credentials.get(SHARED_STATE_PASSWORD);
+ Dictionary<String, Object> properties = cloneProperties();
+ properties.put(Context.SECURITY_PRINCIPAL, usernameObj.toString());
+ properties.put(Context.SECURITY_CREDENTIALS, passwordObj.toString());
+ return new LdapUserAdmin(properties);
+ }