Announcement Announcement Module
Collapse
No announcement yet.
Connect to LDAP Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connect to LDAP

    I am trying to connect my insight dashboard to ldap so users can login. I went through the following url:

    http://pubs.vmware.com/vfabric51/top...all-setup-ldap

    When I start my insight instance I get the below errors. Has anyone setup ldap connectivity with their dashboard?

    Code:
    02-Aug-2012 11:25:01.778 INFO [pool-3-thread-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
    02-Aug-2012 11:25:25.347 SEVERE [pool-3-thread-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean] while setting bean property 'parent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#14': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'insightAuthenticationProvider' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'insightAuthenticationProvider' is defined
    ...
    ...
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#14': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'insightAuthenticationProvider' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'insightAuthenticationProvider' is defined
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:274)
    	... 29 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'insightAuthenticationProvider' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'insightAuthenticationProvider' is defined
    ....
    .....
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'insightAuthenticationProvider' is defined
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    	... 45 more
    
    02-Aug-2012 11:25:25.378 INFO [pool-3-thread-1] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
    Within my insight-plugin-dashboard-security-ldap.xml I have the following:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    
    	<bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
    		<constructor-arg value="ldap://test.thetest.com:389/dc=thetest,dc=com"/>
    		<property name="userDn" value="cn=user,ou=Area,ou=Test,dc=thetest,dc=com"/>
    		<property name="password" value="password"/>
    	</bean>
    	
    	<bean id="insightAuthenticationProvider" class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
    		<constructor-arg>
    			<bean class="org.springframework.security.ldap.authentication.BindAuthenticator">
    				<constructor-arg ref="contextSource"/>
    				<property name="userDnPatterns">
    					<list><value>ou=Test,dc=thetest,dc=com</value></list>
    				</property>
    			</bean>
    		</constructor-arg>
    		<constructor-arg>
    			<bean class="com.springsource.insight.dashboard.plugins.security.ldap.TransformingLdapAuthoritiesPopulator">
    				<constructor-arg>
    					<bean class="org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator">
    						<constructor-arg ref="contextSource"/>
    						<constructor-arg value="(&amp;(objectClass=groupOfUniqueNames)(cn={0}))"/>
    						<property name="groupSearchFilter" value="uniquemember={0}"/>
    					</bean>
    				</constructor-arg>
    				<constructor-arg>
    					<map>
    						<entry key="staff" value="insight"/>
    						<entry key="admin" value="insight_admin"/>
    					</map>
    				</constructor-arg>
    			</bean>
    		</constructor-arg>
    	</bean>
    	
    </beans>

  • #2
    Has anyone done this?

    The ldif for the user is:

    HTML Code:
    version: 1
    
    dn: cn=user,ou=Area,o=Test,c=US
    objectClass: inetOrgPerson
    objectClass: organizationalPerson
    objectClass: person
    objectClass: testUser
    objectClass: top
    cn: user
    sn: user
    description: 
    fullName: user
    smLoginDisabled: 0
    uid: user
    userPassword:: password
    Last edited by luca3784; Aug 2nd, 2012, 04:35 PM.

    Comment


    • #3
      When I start my insight instance I get the below errors. Has anyone setup ldap connectivity with their dashboard?
      Yes. I've done this several times and it does work. Last time I looked there were some inconsistencies with the documentation though. Probably what is giving you trouble here.

      Caused by: org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'insightAuthenticationProvider' is defined
      Based on the error message and the known issues with the documentation, I'd guess that your insight-plugin-dashboard-security-ldap.xml is not being picked up. Where do you have this file located? It should be in insight/dashboard-plugins/plugin-config, despite what the documentation says.

      Comment

      Working...
      X