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

Exception handing on context.request["SAMLResponse"] KeyError #326

Merged

Conversation

peppelinux
Copy link
Member

A simple PR that fixes an incorrect Exception Handling and a following Error Http Response to users.

@c00kiemon5ter c00kiemon5ter merged commit 38dd8a3 into IdentityPython:master Apr 28, 2020
@peppelinux
Copy link
Member Author

Hi @c00kiemon5ter, thank you for your attention.
I have collected some common exceptions in SATOSA. I would have more time to investigate, for now I just share the these footprints:

    frontend = self.module_router.frontend_routing(context)
  File "lib/python3.7/site-packages/satosa/routing.py", line 103, in frontend_routing
    target_frontend = context.state[STATE_KEY]
  File "lib/python3.7/collections/__init__.py", line 1025, in __getitem__
    raise KeyError(key)
KeyError: 'ROUTER'

------------------------------------------------------------------------

  File "lib/python3.7/site-packages/satosa/backends/saml2.py", line 350, in authn_response
    if context.state[self.name]["relay_state"] != context.request["RelayState"]:
  File "lib/python3.7/collections/__init__.py", line 1025, in __getitem__
    raise KeyError(key)
KeyError: 'Saml2'

------------------------------------------------------------------------

  File "lib/python3.7/site-packages/satosa/backends/saml2.py", line 324, in authn_response
    if not context.request["SAMLResponse"]:
KeyError: 'SAMLResponse'

------------------------------------------------------------------------

  File "lib/python3.7/site-packages/satosa/frontends/saml2.py", line 192, in _handle_authn_request
    req_info = idp.parse_authn_request(context.request["SAMLRequest"], binding_in)
KeyError: 'SAMLRequest'

------------------------------------------------------------------------

  File "lib/python3.7/site-packages/satosa/base.py", line 186, in _auth_resp_callback_func
    internal_response.requester = context.state[STATE_KEY]["requester"]
  File "lib/python3.7/collections/__init__.py", line 1025, in __getitem__
    raise KeyError(key)
KeyError: 'SATOSA_BASE'

------------------------------------------------------------------------

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

Successfully merging this pull request may close these issues.

2 participants