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

fix crash when user ID attribute is missing from reply #484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guillomovitch
Copy link

If one of the attributes mentionned in user_id_from_attrs is missing from the IdP answer, SATOSA will crash with the following exception (missing attribute is called sub in this specific case):

[2025-01-10 10:16:08,259] [ERROR] [satosa.proxy_server.call] Unknown error
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/satosa/base.py", line 268, in run
resp = self._run_bound_endpoint(context, spec)
File "/usr/local/lib/python3.9/site-packages/satosa/base.py", line 193, in _run_bound_endpoint
return spec(context)
File "/usr/local/lib/python3.9/site-packages/satosa/backends/saml2.py", line 482, in authn_response
return self.auth_callback_func(context, self._translate_response(authn_response, context.state))
File "/usr/local/lib/python3.9/site-packages/satosa/base.py", line 154, in _auth_resp_callback_func
subject_id = ""
File "/usr/local/lib/python3.9/site-packages/satosa/base.py", line 155, in
for attr in self.config["INTERNAL_ATTRIBUTES"]["user_id_from_attrs"]:
KeyError: 'sub'

This PR fixes this issue by ensuring missing attributes are skipped.

@guillomovitch guillomovitch force-pushed the hotfix/fix-missing-id-attrs branch 2 times, most recently from 5a599c2 to f5cf5ec Compare January 22, 2025 10:38
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.

1 participant