views:

674

answers:

0

I am trying to integrate Spring Security with my JSF application. I am able to get to make the login page show up, but after a successful login, the protected URL does not show up, it stays on the login page.

My applicationContext.xml:

    <security:http auto-config="true" access-denied-page="/login/loginerror.jspx">
    <security:intercept-url pattern="/restricted/**" access="ROLE_SU"/>
    <security:form-login login-page="/login/login.jspx"
                         default-target-url="/restricted/equipment.jspx"/>
    <security:logout logout-success-url="/logoutSuccess.jspx"/>
</security:http>

<security:authentication-provider user-service-ref="userDetailsService"/>

<bean id="userDetailsService" class="com.teach.security.UserDetailsServiceImpl">
    <property name="rolesDao" ref="RolesDAO"/>
</bean>

My JSF managed bean, the method that get called when the user hits submit on the login page:

public void login()
{
FacesContext.getCurrentInstance().getExternalConte xt().redirect("/spring-    authentication/j_spring_security_check?j_username=" + userId + "&j_password=" + password);
}

My java console confirms a successful login, it says "login successful"

related questions