changing spring security logout-success-url programmatically -


i need redirect user 2 different logout urls based on role. how go doing this?

i using spring security 2.0 , xml looks this:

    <s:http access-denied-page="/" >         <s:intercept-url pattern="/pages/splashpage.jsf" access="is_authenticated_anonymously"/>         <s:intercept-url pattern="/pages/home.jsf" access="role_user,role_merchant"/>          <s:anonymous/>         <s:form-login             login-page="/"             login-processing-url="/j_spring_security_check"             default-target-url="/pages/home.jsf"             authentication-failure-url="/" always-use-default-target='false' />         <s:logout invalidate-session="true" logout-url="/pages/logout.jsf" logout-success-url="/" />         <s:concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="false"/>     </s:http> 

i couldnt find right way this, ended hack:

  1. dont invalidate-session
  2. change logout-success-url special redirect controller
  3. in controller, pull user session tell user type
  4. invalidate session
  5. redirect proper url usertype

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -