-
-
Notifications
You must be signed in to change notification settings - Fork 386
SAML redirect loses session data storing "next" url and RelayState cannot be used instead #481
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
Comments
It suffers the same issues as OpenID, so reuse the code. See python-social-auth/social-app-django#481
Yes, this is because The easiest workaround for this is to disable The very same thing happens with OpenID-based backends. At Weblate we deal with this by including (signed) session ID in the return URL and restoring the session based on that in our wrappers around |
It suffers the same issues as OpenID, so reuse the code. See python-social-auth/social-app-django#481
And Weblate approach is not really usable with SAML, see WeblateOrg/weblate#14924. |
When cookies are created with SameSite policy, they won't be available during the authentication flow which uses POST such as OpenID or SAML. This adds support in Strategy to get session ID and restore it later in the login flow. See python-social-auth/social-app-django#481
This is a Django implementation for changes introduced in python-social-auth/social-core#1159. Fixes python-social-auth#481
python-social-auth/social-core#1159 and #705 is my attempt to address this. |
When cookies are created with SameSite policy, they won't be available during the authentication flow which uses POST such as OpenID or SAML. This adds support in Strategy to get session ID and restore it later in the login flow. See python-social-auth/social-app-django#481
This is a Django implementation for changes introduced in python-social-auth/social-core#1159. Fixes python-social-auth#481
I'm experiencing the same issue with apple backend! I'm currently trying an approach with the session id like the one you mentioned, @nijel, but apple then complains about the return url not being the same as the one configured in service ID. |
Apple is OAuth2, it should not suffer this issue. |
When cookies are created with SameSite policy, they won't be available during the authentication flow which uses POST such as OpenID or SAML. This adds support in Strategy to get session ID and restore it later in the login flow. See python-social-auth/social-app-django#481
This is a Django implementation for changes introduced in python-social-auth/social-core#1159. Fixes #481
Uh oh!
There was an error while loading. Please reload this page.
Expected behaviour
When using social core login with e.g. Django, the "next" parameter should be stored in the strategy session data. Upon authentication with the IdP, the SAML backend should then be able to retrieve the "next" parameter from the session and redirect the user to the desired destination.
If the session data is unavailable, then the redirect url can be obtained from the GET or POST params. In the case of SAML,
RelayState
should be available to use for such purposes.Actual behaviour
SameSite
issues, however this is unclear. Other authentication backends e.g. Google do not lose session data, so this is only happening with SAML backend.RelayState
to pass the "next" url instead. This can then be used to retrieve the required URL from the POST returned from the IdP.Unfortunately
RelayState
appears to be hijacked bysocial_core
to set the IdP name, and there does not appear to be a simple way to override this behaviour:The reasoning appears to be to be able to support multiple providers; however it also breaks what appears to be basic SAML functionality, i.e. being able to use
RelayState
for arbitrary needs such as a dynamically generated redirect URL. In our case, we only require a single SAML provider at this stage.This is outlined in more detail here:
https://stackoverflow.com/questions/70599909/django-social-auth-not-redirecting-to-provided-next-query-param-for-saml-login
Is there a way to be able to reliably pass a "next" parameter using SAML either through the session or request parameters?
The text was updated successfully, but these errors were encountered: