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

Configure relay_state for AssertionConsumer when the SAMLResponse doesn't provide it #18

Open
August-W opened this issue Apr 13, 2020 · 1 comment

Comments

@August-W
Copy link

Depending on the SP/IDP you are working with, the request might not contain a "RelayState" parameter. I was able to set it in my project by extending the class, but it would be nice if you could set the value without doing that

@oculos
Copy link

oculos commented Jun 13, 2024

I am confused - this was supposed to be fixed, right?

I get this:

Traceback (most recent call last):
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/app.py", line 1498, in __call__
    return self.wsgi_app(environ, start_response)
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/app.py", line 1476, in wsgi_app
    response = self.handle_exception(e)
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/views.py", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask/views.py", line 191, in dispatch_request
    return current_app.ensure_sync(meth)(**kwargs)  # type: ignore[no-any-return]
  File "/root/saml-test/venv/lib/python3.9/site-packages/flask_saml2/sp/views.py", line 82, in post
    relay_state = request.form['RelayState']
  File "/root/saml-test/venv/lib/python3.9/site-packages/werkzeug/datastructures/structures.py", line 196, in __getitem__
    raise exceptions.BadRequestKeyError(key)
werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
KeyError: 'RelayState'

Is there anything I can do to make it work, @August-W ?

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

No branches or pull requests

2 participants