I try to implément cas-server module but i would like to change the way the logout works.
Is it possible to redirect to "destination url" without passing by "you have been logout" screen.
Possibility of "drupal_goto($url)" in a gateway situation, maybe a parameter in settings ?
Many thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | cas-redirect-on-login-1151600-13.patch | 3.27 KB | reswild |
| #6 | cas_server.module.diff | 237 bytes | mab974 |
| #4 | 1151600.patch | 588 bytes | bfroehle |
Comments
Comment #1
bfroehle commentedHi mab974,
This feature is not likely to be included as it does not conform to the CAS protocol.
That said, you should be able to figure out how to hack the module to get it to do what you desire.
Comment #2
mab974 commentedHi bfroehle,
Thank you for the answer.
I've verified the Rubycas server i used for many years and which i would like to replace in some cases where Drupal is present.
Rubycas receive, added to the url (logoutwithurl), a "&gateway=true" parameter and interpret it so it give an ability to do a "gateway logout" such that CAS does not present logout UI but just redirects back to the application.
This way, Cas protocol is safe and i think this feature may be interesting here like it was for Rubycas.
As you said i've already hacked the module but it's so comfortable to update modules without correct them every time.
Regards
Comment #3
bfroehle commentedOh, that's nice to know (from the changelog):
If you want to provide a patch which implements this feature I'd be willing to commit it.
Comment #4
bfroehle commentedIs this what you had in mind? I don't use the CAS Server module regularly, so it'd be best if somebody else could test this out and report back.
Comment #6
mab974 commentedSorry for my long absence.
My patch is almost the same as yours except
$ _GET ['Gateway']
which is replaced by a test of 'url'
(strpos($_GET['url'], "?gateway"))
Comment #7
bfroehle commentedI don't understand why you would use (strpos($_GET['url'], "?gateway")) --- this would mean you are looking for a redirection URL which has '?gateway' in it... Is that really what you want?
Comment #8
mab974 commentedI've tried to use $ _GET ['Gateway'] which is not accessible there.
I think that '?gateway' is part of the url which is not treated by phpcas (v1.2.0) but just passed to cas_server logout function.
Maybe, there is a prettier solution for passing this information without modifying phpcas and the concerned web apps.
I don't know how rubycas is doing that job.
Comment #9
bfroehle commentedAre there any security issues with automatically redirecting to an arbitrary location (rather than just providing a link?)
Comment #10
bfroehle commentedComment #11
thecarlhall commented"gateway" has defined use in the /login area of the CAS protocol spec (section 2.1). The Rubycas impl doesn't really deviate from that but the intentions are subtly different. The Jasig CAS server uses "service" to redirect after login but also requires that the functionality be enabled.
I don't see the two approaches as being in conflict and together could provide an interesting setup.
What do y'all think?
Comment #12
bfroehle commentedAs long as we stay near the CAS specification or what other comparable CAS servers are doing, I'm okay with it.
Comment #13
reswild commentedHere is a patch that should conform to the CAS specification. It adds a setting in the CAS Server module whether to allow redirects, and then redirects on logout if the "service" parameter is used, and prints a link if the "url" parameter is used instead. If both "service" and "url" is used, it redirects if allowed in the settings, and prints a link if redirect is disallowed.
I also added a setting in the cas module for whether to pass the redirect url as "service", "url", or both when logging out.