From 6358adeb3b7f83f7109f802a22fca027725e1d71 Mon Sep 17 00:00:00 2001 From: sebulibah Date: Tue, 14 Mar 2023 08:36:14 +0000 Subject: [PATCH] fix: handle case where entity_id is None in start_logout --- src/satosa/backends/saml2.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/satosa/backends/saml2.py b/src/satosa/backends/saml2.py index efcf17b94..33b1a225c 100644 --- a/src/satosa/backends/saml2.py +++ b/src/satosa/backends/saml2.py @@ -204,10 +204,14 @@ def start_logout(self, context, internal_req, internal_authn_resp): :type context: satosa.context.Context :type internal_req: satosa.internal.InternalData - :rtype: + :rtype: satosa.response.Response """ - entity_id = self.get_idp_entity_id(context) + entity_id = internal_authn_resp["auth_info"]["issuer"] + if entity_id is None: + message = "Logout Failed" + status = "500 FAILED" + return Response(message=message, status=status) return self.logout_request(context, entity_id, internal_authn_resp) def disco_query(self, context):