Skip to content

Commit f5cf5ec

Browse files
author
Guillaume Rousse
committed
fix crash when user ID attribute is missing from reply
1 parent 2644c73 commit f5cf5ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/satosa/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ def _auth_resp_callback_func(self, context, internal_response):
151151

152152
# If configured construct the user id from attribute values.
153153
if "user_id_from_attrs" in self.config["INTERNAL_ATTRIBUTES"]:
154-
subject_id = [
155-
"".join(internal_response.attributes[attr]) for attr in
156-
self.config["INTERNAL_ATTRIBUTES"]["user_id_from_attrs"]
157-
]
154+
subject_id = []
155+
for attr in self.config["INTERNAL_ATTRIBUTES"]["user_id_from_attrs"]:
156+
if attr in internal_response.attributes:
157+
subject_id.append("".join(internal_response.attributes[attr]))
158158
internal_response.subject_id = "".join(subject_id)
159159

160160
if self.response_micro_services:

0 commit comments

Comments
 (0)