PDA

View Full Version : Redirect to / after login in glassfish 2.0



abaddon666
Sep 15th, 2011, 09:12 AM
Hello

I'm new in spring security and i have some problems in the after login process. The first time the user login the application it's redirected to http://192.168.2.143:36582/web/ or http://192.168.2.143:36582/web/favicon.ico. but the next i login the app time the redirect process is well executed. My configuration file is:

<security:http auto-config="true" >
<!-- Restrict URLs based on role -->
<security:intercept-url pattern="/login*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:intercept-url pattern="/css/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:intercept-url pattern="/images/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />

<security:intercept-url pattern="/**" access="ROLE_USER, ROLE_ADMIN, ROLE_SUPERVISOR, ROLE_CLINIC" />

<!-- Override default login and logout pages -->
<security:form-login login-page="/login.jsp"
login-processing-url="/loginProcess"
default-target-url="/pci-flow.html"
authentication-failure-url="/login.jsp?login_error=1" />
<security:logout logout-url="/logout" invalidate-session="true" logout-success-url="/login.jsp" />
</security:http>

But it only happens when i excecute the web application inside a Glassfish server 2.0 if I run the app insite the 3.0 version of glassfish I don't have that problem, I have some days trying to fix this problem.

I will apreciate any tip I'm realiy desperate. Tanks

Rob Winch
Sep 15th, 2011, 11:59 PM
You should grant access to any user for the favicon.ico (or anything else that the page may be requesting on the login page).

PS: Please use the code tags (i.e. the # button) for posting code/configs/logs as this makes it easier to read.