Announcement Announcement Module
Collapse
No announcement yet.
login form using spring security ldap Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • login form using spring security ldap

    i'm new with spring security
    i have developped a sample project using spring security and it work correctly
    and this is the application-context-securyty.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
     
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:security="http://www.springframework.org/schema/security"
    	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-2.0.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">
    
    	<security:global-method-security />
    
    	<security:http auto-config="false" entry-point-ref="authenticationProcessingFilterEntryPoint">
    		<security:intercept-url pattern="/index.jsp" filters="none" />
    		<security:intercept-url pattern="/*.action" access="ROLE_USER" />
    
            			 <security:logout logout-success-url="/index.jsp"/>
    	</security:http>
    
    	<bean id="authenticationProcessingFilter" class="com.wct.security.MyAuthenticationProcessingFilter">
    		<security:custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
    		<property name="defaultTargetUrl" value="/main.html" />
    		<property name="authenticationManager" ref="authenticationManager" />
    	</bean>
    
    	<security:authentication-manager alias="authenticationManager" />
    
    	<bean id="authenticationProcessingFilterEntryPoint"
    		class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
    		<property name="loginFormUrl" value="/index.jsp" />
    		<property name="forceHttps" value="false" />
    	</bean>
    
     
        <security:authentication-provider>
         
            <security:user-service>
                <security:user name="admin" password="admin" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
                
    	    </security:user-service>
    	</security:authentication-provider>
    </beans>
    but when i changed to use spring security ldap it does not work
    please i need some help

    this is the new code
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
     
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:security="http://www.springframework.org/schema/security"
    	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
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    
    	
    
    	<security:http >
    		<security:intercept-url pattern="/index.jsp" filters="none" />
    		<security:intercept-url pattern="/*.action" access="ROLE_USER" />
    		
    		<security:logout logout-success-url="/index.jsp"/>
    	
    <security:form-login login-page="/index.jsp" 
                         default-target-url="/main.jsp" />
    </security:http>
    
        <!--
        Usernames/Passwords are
            rod/koala
            dianne/emu
            scott/wombat
            peter/opal
        These passwords are from spring security app example    
        -->
        <security:authentication-manager>
    	        <security:ldap-authentication-provider  
    	        		user-search-filter="(uid={0})" 
    	        		user-search-base="ou=users"
    	        		group-search-filter="(uniqueMember={0})"
    	        		group-search-base="ou=groups"
    	        		group-role-attribute="cn"
    	        		role-prefix="ROLE_">
    	        </security:ldap-authentication-provider>
    	</security:authentication-manager>
    	
    	<security:ldap-server url="ldap://localhost:10389/o=mojo" manager-dn="uid=admin,ou=system" manager-password="secret" />
    
    
    </beans>
Working...
X