Skip to content

Commit

Permalink
fix crash when user ID attribute is missing from reply
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Rousse committed Jan 10, 2025
1 parent 2644c73 commit f5cf5ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/satosa/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ def _auth_resp_callback_func(self, context, internal_response):

# If configured construct the user id from attribute values.
if "user_id_from_attrs" in self.config["INTERNAL_ATTRIBUTES"]:
subject_id = [
"".join(internal_response.attributes[attr]) for attr in
self.config["INTERNAL_ATTRIBUTES"]["user_id_from_attrs"]
]
subject_id = []
for attr in self.config["INTERNAL_ATTRIBUTES"]["user_id_from_attrs"]:
if attr in internal_response.attributes:
subject_id.append("".join(internal_response.attributes[attr]))
internal_response.subject_id = "".join(subject_id)

if self.response_micro_services:
Expand Down

0 comments on commit f5cf5ec

Please sign in to comment.