tags:

views:

66

answers:

1

Is there a way to implement this?

redirect(url: "${myDomain1RootUrl}/j_spring_security_logout") // make this asynchronous call
redirect(url: "${myDomain2RootUrl}/j_spring_security_logout") // make this asynchronous call
redirect(uri: "/j_spring_security_logout")

Basically, this code is going to logout the session for several internal domains and then finally, it logs out of the current site. Is this possible?

Thanks.

+1  A: 

No, you can't have multiple redirects. But Spring Security supports a 'logoutSuccessUrl' parameter which you can use to chain the requests. Go to url1 which logs out and redirects to url2, which logs out and redirects back to this app and logs out:

String url1 = "${myDomain1RootUrl}/j_spring_security_logout"
String url2 = "${myDomain2RootUrl}/j_spring_security_logout"
String url3 = createLink(uri: "/j_spring_security_logout", absolute: true)

String twoPlusThree = url2 + '?logoutSuccessUrl=' + URLEncoder.encode(url3)
String all = url1 + '?logoutSuccessUrl=' + URLEncoder.encode(twoPlusThree)
redirect url: all
Burt Beckwith
great! i tested this and it worked. this is what i really need. thanks a lot!
firnnauriel