polubothusatish Posted October 21, 2013 Share Posted October 21, 2013 Hi, Can some one check the code to see what is wrong with the LDAP code with the diagram that i provided: applicationContext-security.xml:<!-- AuthenticationManger --> <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager"> <property name="providers"> <list> <ref local="ldapAuthenticationProvider"/> <ref bean="${bean.daoAuthenticationProvider}"/> <ref bean="anonymousAuthenticationProvider"/> </list> </property></bean> <!--AnonymousAuthenticationProvider --><bean id="anonymousAuthenticationProvider" class="org.springframework.security.providers.anonymous.AnonymousAuthenticationProvider"> <property name="key"><value>foobar</value></property></bean> <!-- login Authentication --> <bean id="ldapContextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource"> <constructor-arg value="ldap://102.253.253.130:389/dc=comcast,dc=com"/> <property name="userDn"><value>cn=Manager,ou=clients,ou=employees,dc=comcast,dc=com</value></property> <property name="password"><value>secret</value></property> <property name="referral" value="follow" /> </bean> <!--userSearch_ALL --> <bean id="userSearch_ALL" class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch"><constructor-arg index="0" value=""/><constructor-arg index="1" value="(&(sAMAccountName={0})(|(memberOf=cn=Manager,ou=clients,dc=comcast,dc=com)(memberOf=cn=Manager,ou=employees,dc=comcast,dc=com)))" /><constructor-arg index="2" ref=" ldapContextSource " /> </bean> <!-- ldapAuthenticationProvider and userDnPatterns --><bean id="ldapAuthenticationProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider"> <constructor-arg><bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator"><constructor-arg ref=" ldapContextSource "/><property name="userDnPatterns" value="ou=clients" /><property name="userSearch" ref=" userSearch_ALL "/> </bean> < !--DefaultLdapAuthoritiesPopulator--><bean class="org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator"><constructor-arg ref=" ldapContextSource" /><constructor-arg value=""/> <property name="rolePrefix" value=""/><property name="convertToUpperCase" value="true"/><property name="searchSubtree" value="true"></property> <property name="groupRoleAttribute" value="cn" /> <property name="groupSearchFilter" value="(&(objectClass=group)(member={0}))" /></bean></constructor-arg></bean> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now