-
Notifications
You must be signed in to change notification settings - Fork 78
Description
Currently rack-cas sends the user's request path as 'service_url'. The service_url however is used as the unique identifier for the service on the authenticating server side.
So if the request is with service_url mysite.com/users/profile, the ticket that is issued is not going to be considered a valid ticket for mysite.com/history or any other path on the site other than /users/profile.
As far as I can tell, this issue is masked by the fact that a lot of people (myself included) load the user info from session, and consider the user authorized as long as session['cas'] is set, without actually validating the user ticket. I don't see any automatic call to 'validation' in rack-cas gem.
I don't see anything in the CAS specification that describes decoupling service_url from return url that user should be redirected to - I think this is a failure in the spec. I submitted patches to rubycas-server and rack-cas-client to use an additional 'from' parameter that would hold the service path that would be combined with the service_url to generate the user return url for redirection.
I can submit a similar patch to your project if you agree that this is a good solution to the problem.