This webpage has a redirect loop, Spring application -
i have web application in following environment.
- spring 3.2.2 (recently upgraded spring 3.2.0).
- spring security 3.2.0 m1.
- hibernate 4.2.0 cr1.
- apache tomcat 7.0.35.0.
- oracle 10g.
- netbeans 7.2.1 jdk-7u11.
the application runs on base url : http://localhost:8080/wagafashion/
. has no problem, goes fine.
since i'm using spring security, action of login page mapped j_spring_security_check
.
after successful login, if enter url : http://localhost:8080/wagafashion/j_spring_security_check
in address bar (either accidentally or deliberately), page redirected home page, first page given authenticated user, following message in google chrome,
this webpage has redirect loop
as can seen in following snap shot.
no page can accessed once happens. i'm using following browsers.
- google chrome 26.0.1410.64 m
- firefox 20.0.1
- internet explorer 8
this requires cookies cleared resume application. can problem somewhere in application. how fix this?
my spring-security.xml
file follows.
<?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.2.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> <http pattern="/login.htm*" security="none"></http> <http auto-config='true' use-expressions="true" disable-url-rewriting="true"> <!--<remember-me key="myappkey"/>--> <session-management session-fixation-protection="newsession"> <concurrency-control max-sessions="1" error-if-maximum-exceeded="true" /> </session-management> <intercept-url pattern="/admin_side/**" access="hasrole('role_admin')" requires-channel="any"/> <form-login login-page="/" default-target-url="/admin_side/home.htm" authentication-failure-url="/loginfailed.htm" authentication-success-handler-ref="loginsuccesshandler"/> <logout logout-success-url="/login.htm" invalidate-session="true" delete-cookies="jsessionid"/> </http> <authentication-manager> <authentication-provider> <jdbc-user-service data-source-ref="datasource" users-by-username-query="select email_id, password, enabled user_table lower(email_id)=lower(?)" authorities-by-username-query="select ut.email_id, ur.authority user_table ut, user_roles ur ut.user_id=ur.user_id , lower(ut.email_id)=lower(?)"/> </authentication-provider> </authentication-manager> <beans:bean id="loginsuccesshandler" class="loginsuccesshandler.loginsuccesshandler"/> <global-method-security secured-annotations="enabled" proxy-target-class="false"> <protect-pointcut expression="execution(* dao.*.*(..))" access="role_admin"/> </global-method-security> </beans:beans>
i tried setup gave same result you. solve problem did this,
in security.xml change:
<form-login login-page="/"... <form-login login-page="/login.htm"...
Comments
Post a Comment