Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect upon successful authentication #73

Open
dekhaus opened this issue Mar 11, 2017 · 1 comment
Open

Redirect upon successful authentication #73

dekhaus opened this issue Mar 11, 2017 · 1 comment
Labels

Comments

@dekhaus
Copy link

dekhaus commented Mar 11, 2017

Hi All

I need to redirect the user to the page they requested upon successful authentication. I'm reasonably sure this is possible - but I can't find details on how to set this up.

For example - say a user is not logged into my site that uses rack-cas. They click on a link in an email which points to a page that requires authentication. CAS authentication 'kicks in' and once the user logs in - currently they're not taken to the page they requested - but rather the sites homepage.

I'm sure this is a well known issue / feature request. So - is this possible and what's changes need to be made to achieve this result ?

Thanks
Dave

@adamcrown
Copy link
Collaborator

adamcrown commented Mar 12, 2017

Hi Dave,

This should be the default behavior. When your app responds with a 401 status, rack-cas should catch that response and turn it into a redirect to your CAS server that has the requested URL to your app as the ?service= query string param. Your CAS server, should then take that service param and use it to redirect you back to that same URL once authentication is complete.

You should be able to track that service param in the URL to see if it's correct. You should also be able to watch the logs to make sure your CAS server is using that URL to send you back to the app. It could be that your CAS server is actually the one causing the problem, because all that rack-cas can do is pass the right URL in the service param and trust the CAS server to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants