You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by vk...@apache.org on 2008/09/22 15:49:23 UTC

svn commit: r697827 - in /portals/jetspeed-2/portal/branches/security-refactoring: components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/ components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/ldap/dao/im...

Author: vkumar
Date: Mon Sep 22 06:49:22 2008
New Revision: 697827

URL: http://svn.apache.org/viewvc?rev=697827&view=rev
Log:
Few more changes in LDAP code

Removed:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapBindingConfig.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/ldapConfig.xml
Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/LdapAuthenticationProvider.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/ldap/dao/impl/SpringLDAPEntityDAO.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapContextProxy.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-ldap.xml

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/LdapAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/LdapAuthenticationProvider.java?rev=697827&r1=697826&r2=697827&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/LdapAuthenticationProvider.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/LdapAuthenticationProvider.java Mon Sep 22 06:49:22 2008
@@ -25,7 +25,6 @@
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
-import javax.naming.ldap.LdapContext;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.jetspeed.i18n.KeyedMessage;
@@ -38,8 +37,7 @@
 import org.apache.jetspeed.security.UserManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalSynchronizer;
 import org.apache.jetspeed.security.spi.UserPasswordCredentialManager;
-import org.apache.jetspeed.security.spi.impl.PasswordCredentialImpl;
-import org.apache.jetspeed.security.spi.impl.ldap.LdapBindingConfig;
+import org.apache.jetspeed.security.spi.impl.ldap.LdapContextProxy;
 
 /**
  * @author <a href="mailto:vkumar@apache.org">Vivek Kumar</a>
@@ -48,11 +46,9 @@
 public class LdapAuthenticationProvider extends BaseAuthenticationProvider
 {
     private JetspeedPrincipalSynchronizer synchronizer;
-    private LdapContext context;
-    private LdapBindingConfig config;
     private UserPasswordCredentialManager upcm;
     private UserManager manager;
-
+    private LdapContextProxy context;
     public LdapAuthenticationProvider(String providerName, String providerDescription, String loginConfig, UserPasswordCredentialManager upcm,
                                       UserManager manager)
     {
@@ -61,12 +57,7 @@
         this.manager = manager;
     }
 
-    public void setConfig(LdapBindingConfig config)
-    {
-        this.config = config;
-    }
-
-    public void setContext(LdapContext context)
+    public void setContext(LdapContextProxy context)
     {
         this.context = context;
     }
@@ -103,8 +94,8 @@
 
     private boolean authenticateUser(String userName, String password) throws NamingException, SecurityException
     {
-        Hashtable env = context.getEnvironment();
-        
+        Hashtable env = context.getCtx().getEnvironment();
+
         // String savedPassword = String.valueOf(getPassword(uid));
         String oldCredential = (String) env.get(Context.SECURITY_CREDENTIALS);
         String oldUsername = (String) env.get(Context.SECURITY_PRINCIPAL);
@@ -116,8 +107,8 @@
             // Build user dn using lookup value, just appending the user filter after the uid won't work when users
             // are/can be stored in a subtree (searchScope sub-tree)
             // The looked up dn though is/should always be correct, just need to append the root context.
-            if (!StringUtils.isEmpty(config.getRootContext()))
-                dn += "," + config.getRootContext();
+            if (!StringUtils.isEmpty(context.getRootContext()))
+                dn += "," + context.getRootContext();
             env.put(Context.SECURITY_PRINCIPAL, dn);
             env.put(Context.SECURITY_CREDENTIALS, password);
             new InitialContext(env);
@@ -160,7 +151,7 @@
     protected SearchControls setSearchControls()
     {
         SearchControls controls = new SearchControls();
-        controls.setReturningAttributes(config.getKnownAttributes());
+        controls.setReturningAttributes(new String[]{});
         controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
         controls.setReturningObjFlag(true);
         return controls;
@@ -179,10 +170,10 @@
             query = "(&(" + getEntryPrefix() + "=" + (StringUtils.isEmpty(filter) ? "*" : filter) + ")" + getSearchSuffix() + ")";
         }
         // logger.debug("searchByWildCardedUid = " + query);
-        cons.setSearchScope(Integer.parseInt(config.getMemberShipSearchScope()));
+        cons.setSearchScope(Integer.parseInt(context.getMemberShipSearchScope()));
         // TODO: added this here for OpenLDAP (when users are stored in ou=People,o=evenSeas)
-        String searchBase = StringUtils.replace(getSearchDomain(), "," + config.getRootContext(), "");
-        NamingEnumeration results = ((DirContext) context).search(searchBase, query, cons);
+        String searchBase = StringUtils.replace(getSearchDomain(), "," + context.getRootContext(), "");
+        NamingEnumeration results = ((DirContext) context.getCtx()).search(searchBase, query, cons);
         return results;
     }
 
@@ -196,7 +187,7 @@
             String searchDomain = getSearchDomain();
             if (searchDomain.length() > 0)
             {
-                userDn += "," + StringUtils.replace(searchDomain, "," + config.getRootContext(), "");
+                userDn += "," + StringUtils.replace(searchDomain, "," + context.getRootContext(), "");
             }
         }
         return userDn;
@@ -204,16 +195,16 @@
 
     private String getSearchSuffix()
     {
-        return config.getUserFilter();
+        return  context.getUserFilter();
     }
 
     private String getEntryPrefix()
     {
-        return config.getUserIdAttribute();
+        return  "cn";
     }
 
     private String getSearchDomain()
     {
-        return config.getUserFilterBase();
+       return "";
     }
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/ldap/dao/impl/SpringLDAPEntityDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/ldap/dao/impl/SpringLDAPEntityDAO.java?rev=697827&r1=697826&r2=697827&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/ldap/dao/impl/SpringLDAPEntityDAO.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/ldap/dao/impl/SpringLDAPEntityDAO.java Mon Sep 22 06:49:22 2008
@@ -23,18 +23,18 @@
 import javax.naming.directory.SearchControls;
 
 import org.apache.commons.lang.StringUtils;
-import org.springframework.ldap.core.ContextMapper;
-import org.springframework.ldap.core.LdapTemplate;
-import org.springframework.ldap.filter.EqualsFilter;
-import org.springframework.ldap.filter.Filter;
-import org.springframework.ldap.filter.OrFilter;
-
 import org.apache.jetspeed.security.mapping.ldap.dao.DefaultEntityContextMapper;
 import org.apache.jetspeed.security.mapping.ldap.dao.EntityDAO;
 import org.apache.jetspeed.security.mapping.ldap.dao.LDAPEntityDAOConfiguration;
 import org.apache.jetspeed.security.mapping.ldap.dao.SearchUtil;
 import org.apache.jetspeed.security.mapping.ldap.filter.SimpleFilter;
 import org.apache.jetspeed.security.mapping.model.Entity;
+import org.springframework.ldap.core.ContextMapper;
+import org.springframework.ldap.core.DistinguishedName;
+import org.springframework.ldap.core.LdapTemplate;
+import org.springframework.ldap.filter.EqualsFilter;
+import org.springframework.ldap.filter.Filter;
+import org.springframework.ldap.filter.OrFilter;
 
 /**
  * @author <a href="mailto:ddam@apache.org">Dennis Dam</a>
@@ -42,11 +42,8 @@
  */
 public class SpringLDAPEntityDAO implements EntityDAO
 {
-
     protected LdapTemplate ldapTemplate;
-
     protected LDAPEntityDAOConfiguration configuration;
-
     private ContextMapper contextMapper;
 
     public void initialize(LdapTemplate ldapTemplate)
@@ -61,7 +58,8 @@
         if (entities != null && entities.size() == 1)
         {
             return entities.iterator().next();
-        } else
+        }
+        else
         {
             return null;
         }
@@ -78,25 +76,25 @@
         Filter combinedFilter = null;
         if (configuration.getBaseFilter() != null)
         {
-            combinedFilter = SearchUtil.andFilters(idFilter, configuration
-                    .getBaseFilter());
-        } else
+            combinedFilter = SearchUtil.andFilters(idFilter, configuration.getBaseFilter());
+        }
+        else
         {
             combinedFilter = idFilter;
         }
         return getEntities(combinedFilter);
     }
 
-    public Collection<Entity> getEntitiesByInternalId(
-            Collection<String> internalIds)
+    public Collection<Entity> getEntitiesByInternalId(Collection<String> internalIds)
     {
         final Collection<Entity> resultSet = new ArrayList<Entity>();
-        for (Iterator<String> iterator = internalIds.iterator(); iterator
-                .hasNext();)
+        for (Iterator<String> iterator = internalIds.iterator(); iterator.hasNext();)
         {
             String internalId = (String) iterator.next();
-            Entity resultEntity = (Entity) ldapTemplate.lookup(internalId,
-                    contextMapper);
+            DistinguishedName principalDN = new DistinguishedName(internalId);
+            principalDN.removeFirst();
+            internalId =principalDN.toString();            
+            Entity resultEntity = (Entity) ldapTemplate.lookup(internalId, contextMapper);
             if (resultEntity != null)
             {
                 resultSet.add(resultEntity);
@@ -113,10 +111,10 @@
             if (filter == null)
             {
                 filter = configuration.getBaseFilter();
-            } else
+            }
+            else
             {
-                filter = SearchUtil.andFilters(configuration.getBaseFilter(),
-                        filter);
+                filter = SearchUtil.andFilters(configuration.getBaseFilter(), filter);
             }
         }
         String filterStr = filter.toString();
@@ -124,16 +122,12 @@
         {
             filterStr = "(objectClass=*)"; // trivial search query
         }
-        return (Collection<Entity>) ldapTemplate.search(configuration
-                .getBaseDN(), filterStr, SearchControls.SUBTREE_SCOPE,
-                getContextMapper());
+        return (Collection<Entity>) ldapTemplate.search(configuration.getBaseDN(), filterStr, SearchControls.SUBTREE_SCOPE, getContextMapper());
     }
 
     public Collection<Entity> getAllEntities()
     {
-        final String finalFilter = configuration.getBaseFilter() != null ? configuration
-                .getBaseFilter().encode()
-                : "(objectClass=*)";
+        final String finalFilter = configuration.getBaseFilter() != null ? configuration.getBaseFilter().encode() : "(objectClass=*)";
         return getEntities(new SimpleFilter(finalFilter));
     }
 
@@ -161,9 +155,7 @@
 
     protected Filter createFilterForIdSearch(String entityId)
     {
-        return SearchUtil.constructMatchingFieldsFilter(configuration
-                .getBaseFilter(), new String[]
-        { configuration.getLdapIdAttribute(), entityId});
+        return SearchUtil.constructMatchingFieldsFilter(configuration.getBaseFilter(), new String[] { configuration.getLdapIdAttribute(), entityId });
     }
 
     public ContextMapper getContextMapper()
@@ -184,5 +176,4 @@
     {
         this.contextMapper = contextMapper;
     }
-
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapContextProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapContextProxy.java?rev=697827&r1=697826&r2=697827&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapContextProxy.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapContextProxy.java Mon Sep 22 06:49:22 2008
@@ -19,7 +19,6 @@
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
 import java.util.Properties;
 
 import javax.naming.CommunicationException;
@@ -29,7 +28,7 @@
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
-import org.apache.commons.lang.StringUtils;
+import org.springframework.ldap.core.support.LdapContextSource;
 
 /**
  * @author <a href="mailto:vkumar@apache.org">Vivek Kumar</a>
@@ -39,40 +38,27 @@
 {
     private Properties env;
     private LdapContext ctx;
+    private LdapContextSource springContext;
+    private String initialContextFactory;    
+    private String userFilter;
+    private String memberShipSearchScope;
     
-    public static LdapContext createProxy(LdapBindingConfig config)
-    {
-        LdapContext proxy = config.getContext();
-        
-        if ( proxy == null || !(Proxy.getInvocationHandler(proxy) instanceof LdapContextProxy))
-        {
-            proxy = (LdapContext)Proxy.newProxyInstance(LdapContext.class.getClassLoader(),new Class[]{LdapContext.class}, new LdapContextProxy(config));
-     
-            config.setContext(proxy);
-        }
-        return proxy;
-    }
-    
-    private LdapContextProxy(LdapBindingConfig ldapBindingConfig)
-    {
+   
+    public LdapContextProxy(LdapContextSource context,String factory,String userFilter,String memberShipSearchScope)    {
+        springContext = context; 
         env = new Properties();
-        env.put(Context.INITIAL_CONTEXT_FACTORY, ldapBindingConfig.getInitialContextFactory());
-        env.put(Context.PROVIDER_URL, ldapBindingConfig.getLdapScheme() + "://" + ldapBindingConfig.getLdapServerName() + ":"
-                + ldapBindingConfig.getLdapServerPort() + "/" + ldapBindingConfig.getRootContext());
-        env.put(Context.SECURITY_PRINCIPAL, ldapBindingConfig.getRootDn());
-        env.put(Context.SECURITY_CREDENTIALS, ldapBindingConfig.getRootPassword());
-        env.put(Context.SECURITY_AUTHENTICATION, ldapBindingConfig.getLdapSecurityLevel());
-        if ( !StringUtils.isEmpty(ldapBindingConfig.getLdapSecurityProtocol()) )
-        {
-            env.put(Context.SECURITY_PROTOCOL, ldapBindingConfig.getLdapSecurityProtocol());
-        }
-        if ( !StringUtils.isEmpty(ldapBindingConfig.getLdapSocketFactory()) )
-        {
-            env.put("java.naming.ldap.factory.socket", ldapBindingConfig.getLdapSocketFactory());
-        }
+        env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
+        env.put(Context.PROVIDER_URL,springContext.getUrls()[0]+"/" + springContext.getBaseLdapPath());
+        env.put(Context.SECURITY_AUTHENTICATION, "simple");
+        env.put(Context.SECURITY_CREDENTIALS, springContext.getAuthenticationSource().getCredentials());
+        env.put(Context.SECURITY_PRINCIPAL, springContext.getAuthenticationSource().getPrincipal());
+        
+        this.initialContextFactory = factory;
+        this.userFilter = userFilter;
+        this.memberShipSearchScope = memberShipSearchScope;
     }
     
-    private LdapContext getCtx() throws NamingException
+    public LdapContext getCtx() throws NamingException
     {
         if ( ctx == null )
         {
@@ -153,5 +139,23 @@
         }
         return result;
     }
+    public String getInitialContextFactory()
+    {
+        return initialContextFactory;
+    }
+
+    public String getUserFilter()
+    {
+        return userFilter;
+    }
+
+    public String getRootContext()
+    {
+        return springContext.getBaseLdapPathAsString();
+    }
+    public String getMemberShipSearchScope()
+    {
+        return memberShipSearchScope;
+    }
 
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-ldap.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-ldap.xml?rev=697827&r1=697826&r2=697827&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-ldap.xml (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-ldap.xml Mon Sep 22 06:49:22 2008
@@ -53,21 +53,6 @@
 		<constructor-arg index="1" ref="org.apache.jetspeed.security.mapping.SecurityEntityManager" />
 	</bean>	
 		
-	<bean id="ldapContext" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">		
-		<property name="targetClass">
-			<value>org.apache.jetspeed.security.spi.impl.ldap.LdapContextProxy</value>
-		</property>
-   		<property name="targetMethod">
-   			<value>createProxy</value>
-   		</property>
-		<property name="arguments">
-			<list>
-				<ref bean="org.apache.jetspeed.security.spi.impl.ldap.LdapBindingConfig" />
-			</list>    
-		</property>
- 	</bean>
-	
-
 	<bean id="org.apache.jetspeed.security.AuthenticationProvider" class="org.apache.jetspeed.security.impl.LdapAuthenticationProvider">
 		<constructor-arg index="0" value="ldapAuthenticationProvider" />
 		<constructor-arg index="1" value="Ldap Authentication Provider" />
@@ -77,7 +62,6 @@
 		<constructor-arg index="3" ref="org.apache.jetspeed.security.spi.UserPasswordCredentialManager" />
 		<constructor-arg index="4" ref="org.apache.jetspeed.security.UserManager" />
 		<property name="context" ref="ldapContext" />
-		<property name="config" ref="org.apache.jetspeed.security.spi.impl.ldap.LdapBindingConfig" />
 		<property name="synchronizer" ref="JetspeedPrincipalSynchronizer" />
 	</bean>
 	<bean id="JetspeedPrincipalSynchronizer" class="org.apache.jetspeed.security.spi.impl.DefaultJetspeedPrincipalSynchronizer">
@@ -89,8 +73,14 @@
 		<property name="entityDAOs">
 		    <map>
 				<entry key="user" value-ref="UserDao"/>
+				<entry key="role" value-ref="RoleDao"/>
 		    </map>
 		</property>
+		<property name="entityRelationDAOs">
+		    <list>
+				<ref bean="UserRoleRelationDAO" />
+		    </list>
+		</property>		
 	</bean>
 	<bean id="UserDaoConfiguration" class="org.apache.jetspeed.security.mapping.ldap.dao.LDAPEntityDAOConfiguration">
 		<property name="baseDN" value=""/>
@@ -115,12 +105,48 @@
 				<bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
 					<constructor-arg index="0" value="givenName" />
 					<constructor-arg index="1" value="false" />
-					<constructor-arg index="2" value="true" />					
+					<constructor-arg index="2" value="true" />
+					<constructor-arg index="3" value="user.name.given" />					
 				</bean>					
 			</set>
 		</property>
 		<property name="entityType" value="user"/>
 	</bean>
+	<bean id="RoleDaoConfiguration" class="org.apache.jetspeed.security.mapping.ldap.dao.LDAPEntityDAOConfiguration">
+		<property name="baseDN" value=""/>
+		<property name="baseFilter">
+			<bean class="org.apache.jetspeed.security.mapping.ldap.filter.SimpleFilter">
+				<constructor-arg index="0" value="(objectClass=groupOfUniqueNames)" />
+			</bean>
+		</property>
+		<property name="ldapIdAttribute" value="cn"/>
+		<property name="attributeDefinitions">	
+			<set>
+				<bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
+					<constructor-arg index="0" value="uid" />
+					<constructor-arg index="1" value="false" />
+					<constructor-arg index="2" value="true" />
+				</bean>
+				<bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
+					<constructor-arg index="0" value="cn" />
+					<constructor-arg index="1" value="false" />
+					<constructor-arg index="2" value="true" />					
+				</bean>				
+				<bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
+					<constructor-arg index="0" value="description" />
+					<constructor-arg index="1" value="false" />
+					<constructor-arg index="2" value="true" />
+					<constructor-arg index="3" value="role.display.name" />					
+				</bean>					
+				<bean class="org.apache.jetspeed.security.mapping.model.impl.AttributeDefImpl">
+					<constructor-arg index="0" value="uniqueMember" />
+					<constructor-arg index="1" value="true" />
+					<constructor-arg index="2" value="false" />
+				</bean>					
+			</set>
+		</property>
+		<property name="entityType" value="role"/>
+	</bean>
 	<bean id="UserDao" class="org.apache.jetspeed.security.mapping.ldap.dao.impl.SpringLDAPEntityDAO">
 		<property name="ldapTemplate">
 			<bean class="org.springframework.ldap.core.LdapTemplate">
@@ -129,10 +155,45 @@
 		</property>
 		<property name="configuration" ref="UserDaoConfiguration"/>
 	</bean>
+		
+	<bean id="UserRoleRelationDAO" class="org.apache.jetspeed.security.mapping.ldap.dao.impl.AttributeBasedRelationDAO">
+		<property name="ldapTemplate">
+			<bean class="org.springframework.ldap.core.LdapTemplate">
+				<property name="contextSource" ref="LdapSpringContext" />
+			</bean>
+		</property>
+		<property name="relationAttribute" value ="uniqueMember"/>
+		<property name="attributeContainsInternalId" value ="true"/>
+		<property name="useFromEntityAttribute" value="false" />
+		<property name="relationType">		
+			<bean class="org.apache.jetspeed.security.mapping.impl.SecurityEntityRelationTypeImpl">
+				<constructor-arg index="0" value="isMemberOf" />
+				<constructor-arg index="1" value="user" />
+				<constructor-arg index="2" value="role" />
+			</bean>
+		</property>
+	</bean>
+	
+	<bean id="RoleDao" class="org.apache.jetspeed.security.mapping.ldap.dao.impl.SpringLDAPEntityDAO">
+		<property name="ldapTemplate">
+			<bean class="org.springframework.ldap.core.LdapTemplate">
+				<property name="contextSource" ref="LdapSpringContext" />
+			</bean>
+		</property>
+		<property name="configuration" ref="RoleDaoConfiguration"/>
+	</bean>
 	<bean id="LdapSpringContext" class="org.springframework.ldap.core.support.LdapContextSource">
 		<property name="url" value="ldap://localhost:389"/>
 		<property name="base" value="o=sevenSeas"/>
 		<property name="userDn" value="cn=admin,o=sevenSeas"/>
 		<property name="password" value="secret"/>
 	</bean>
-</beans>
+
+	<bean id="ldapContext" class="org.apache.jetspeed.security.spi.impl.ldap.LdapContextProxy" depends-on="LdapSpringContext">
+		<constructor-arg index="0" ref="LdapSpringContext" />
+		<constructor-arg index="1" value="com.sun.jndi.ldap.LdapCtxFactory" />
+		<constructor-arg index="2" value="(objectclass=person)" />
+		<constructor-arg index="3" value="2" />
+ 	</bean>	
+
+</beans>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org