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

[Question] Redirect after logout #390

Open
gregorjerse opened this issue Nov 29, 2023 · 3 comments
Open

[Question] Redirect after logout #390

gregorjerse opened this issue Nov 29, 2023 · 3 comments

Comments

@gregorjerse
Copy link

Hi,

I have implemented SSO using djangosaml2. It works perfectly, except for the part where I would like to redirect the user to a specific (dynamic) page after the logout (initiated by the application).

I see the "RelayState" is used to redirect the user to a specific page after login. Is there a similar feature for logging out? As far I could see from the source code, the saml2 library sets the RelayState when doing logout and it is not possible to override it without changing the code.

@peppelinux
Copy link
Member

Actually the logout uses the logout url defined in the general settings, is there any kind of relay for the saml2 logout?
If not we cannot proceed.

at the same time you can even create a parameter in the user session and have a redirect to the value set to this parameter if present

@gregorjerse
Copy link
Author

Yes, it uses the default logout URL (and this works) but I would like the logout URL to be user-specific.

Is the user not already logged out when post to the LogoutView is performed so I can not use user session to perform the redirect?

@peppelinux
Copy link
Member

even if the user is not authenticated the session is available (AnonUser)

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

No branches or pull requests

2 participants