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

Handle empty RelayState #5

Open
voyc-jean opened this issue Jan 17, 2020 · 3 comments
Open

Handle empty RelayState #5

voyc-jean opened this issue Jan 17, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@voyc-jean
Copy link
Contributor

voyc-jean commented Jan 17, 2020

Hi,

When a login is initiated from an IdP (only tested on G Suite), the Response will include an empty value for the RelayState parameter if a redirect is not specified on the IdP (in the case of G Suite, this is called the Start URL).

Should this library not perhaps check to see if the RelayState value is empty and, in the case that it is, redirect to the default SAML_LOGIN_REDIRECT path?

Please see this line.

OneLogin_Saml2_Error: Redirect to invalid URL: 
  File "django_saml/views.py", line 122, in saml_acs
    url = saml_auth.redirect_to(req['post_data']['RelayState'])
  File "onelogin/saml2/auth.py", line 214, in redirect_to
    return OneLogin_Saml2_Utils.redirect(url, parameters, request_data=self.__request_data)
  File "onelogin/saml2/utils.py", line 216, in redirect
    OneLogin_Saml2_Error.REDIRECT_INVALID_URL

Thank you.

@voyc-jean
Copy link
Contributor Author

To support this:
Section 4.1.5 of the OASIS SAML Standard states:

Of special mention is that the identity provider MAY include a binding-specific "RelayState" parameter that
indicates, based on mutual agreement with the service provider, how to handle subsequent interactions
with the user agent. This MAY be the URL of a resource at the service provider. The service provider
SHOULD be prepared to handle unsolicited responses by designating a default location to send the user
agent subsequent to processing a response successfully.

@ngearhart ngearhart added bug Something isn't working wontfix This will not be worked on labels Mar 16, 2022
@ngearhart
Copy link
Collaborator

I apologize for the lack of response to this issue. Unfortunately, this is currently outside of the scope of work I can handle. Others are welcome to implement this and open a pull request.

@melvyn-apryl
Copy link

PR added.

@ngearhart ngearhart removed the wontfix This will not be worked on label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants