Skip to content

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

Merged
c00kiemon5ter merged 1 commit into
IdentityPython:masterfrom
peppelinux:context_request_keyerror
Apr 28, 2020
Merged

Exception handing on context.request["SAMLResponse"] KeyError#326
c00kiemon5ter merged 1 commit into
IdentityPython:masterfrom
peppelinux:context_request_keyerror

Conversation

@peppelinux

Copy link
Copy Markdown
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
Copy Markdown
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

2 participants