Announcement Announcement Module
Collapse
No announcement yet.
Custom Login form not loading Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Login form not loading

    I'm hoping another set of eyes will help me solve this problem. I'm trying to use a custom login form but I keep getting the "This page isn't redirecting properly" browser error. Usually that means your intercept-url tags are wrong, but I don't think they are. I've included my security-context below. Any advice would be appreciated!

    Thanks

    Code:
    <?xml version="1.0" encoding="UTF-8" ?> 
    <beans:beans xmlns="http://www.springframework.org/schema/security"
      xmlns:beans="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
               http://www.springframework.org/schema/security
               http://www.springframework.org/schema/security/spring-security-3.1.xsd">
             
             
    		<http auto-config="true" use-expressions="true" >		  
    		    <intercept-url pattern="http://localhost:8080/App1/Login*" access="permitAll"/>
    		    <intercept-url pattern="/**" access="hasRole('ROLE_USER')" />  
    		    <form-login login-page="http://localhost:8080/App1/Login"/>  
    		   
    		    <remember-me key="AppKey"  
    		                 services-ref="customRememberMeService" /> 
    		              	
    		</http>        
    		           
    		<!-- authentication manager and password hashing -->
    		 <authentication-manager>
    		    <authentication-provider>
    		      <user-service id="testUserService">
    		        <user name="jimi" password="jimispassword" authorities="ROLE_USER, ROLE_ADMIN" />
    		        <user name="bob" password="bobspassword" authorities="ROLE_USER" />
    		        <user name="ekp5994" password="password" authorities="ROLE_USER" />
    		      </user-service>
    		    </authentication-provider>
    		  </authentication-manager>
    		
    		
    		<beans:bean id="mySecurityDS"
    				class="org.springframework.jndi.JndiObjectFactoryBean">
    				<beans:property name="jndiName"
    					value="java:comp/env/jdbc/DATASOURCE" />
    		</beans:bean>
    		
    		<beans:bean id="customRememberMeService"
    		class="com.company.spring.security.custom.rememberme.CustomDomainCookieRememberMe">
    			<!-- custom-filter position="REMEMBER_ME_FILTER"/ -->
    			<beans:property name="key" value="AppKey" />
    			<beans:property name="tokenRepository" ref="jdbcTokenRepository"/>
    			<beans:property name="userDetailsService" ref="testUserService"/>
    			<beans:property name="cookieName" value="WebApp_COOKIE" />
       		    <beans:property name="tokenValiditySeconds" value="2400" />
    		</beans:bean>
    		
    		 
    		<!-- Uses a database table to maintain a set of persistent login data --> 
    		<beans:bean id="jdbcTokenRepository" class="org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl"> 
    		    <beans:property name="createTableOnStartup" value="false" /> 
    		    <beans:property name="dataSource" ref="mySecurityDS" /> 
    		</beans:bean> 
    </beans:beans>
    Last edited by epaisley; Sep 11th, 2012, 07:52 PM.

  • #2
    I needed to change my intercept-url to

    <intercept-url pattern="http://localhost:8080/App1/Login/*" access="permitAll"/>

    So the spring MVC page at Login/ would render

    Comment

    Working...
    X