I use spring security for user authentication. In security.xml I have
<form-login login-page="/login"
default-target-url="/dashboard"
always-use-default-target="false"
authentication-failure-url="/login/error"
login-processing-url="/j_security_check"/>
I want to be able to configure different target urls for different user roles. How do i do this?
Thanks!
If you're using Spring-Security 3.0 or higher implementing your own AuthenticationSuccessHandler
is the way to go:
<sec:form-login ... authentication-success-handler-ref="successHandler"/>
...
<bean id="successHandler" class="de.....MySpecialAuthenticationSuccessHandler">
Then MySpecialAuthenticationSuccessHandler
can extend one of the default handlers like SavedRequestAwareAuthenticationSuccessHandler
though they are not really inheritance-friendly.
see -
http://forum.springsource.org/showthread.php?t=93541
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With