Skip to content

Commit aa5d3c1

Browse files
author
Florent
committed
Adds expected_binding parameter to ensure we use this specific http binding for the given IdPs when we start the logout procedure.
1 parent b1ab606 commit aa5d3c1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/saml2/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def global_logout(self, name_id, reason="", expire=None, sign=None):
117117
entity_ids = self.users.issuers_of_info(name_id)
118118
return self.do_logout(name_id, entity_ids, reason, expire, sign)
119119

120-
def do_logout(self, name_id, entity_ids, reason, expire, sign=None):
120+
def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
121+
expected_binding=None):
121122
"""
122123
123124
:param name_id: Identifier of the Subject (a NameID instance)
@@ -126,6 +127,8 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None):
126127
:param reason: The reason for doing the logout
127128
:param expire: Try to logout before this time.
128129
:param sign: Whether to sign the request or not
130+
:param expected_binding: Specify the expected binding then not try it
131+
all
129132
:return:
130133
"""
131134
# check time
@@ -142,6 +145,8 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None):
142145
# for all where I can use the SOAP binding, do those first
143146
for binding in [BINDING_SOAP, BINDING_HTTP_POST,
144147
BINDING_HTTP_REDIRECT]:
148+
if expected_binding and binding != expected_binding:
149+
continue
145150
try:
146151
srvs = self.metadata.single_logout_service(entity_id,
147152
binding,

0 commit comments

Comments
 (0)