Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/saml2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def global_logout(self, name_id, reason="", expire=None, sign=None):
entity_ids = self.users.issuers_of_info(name_id)
return self.do_logout(name_id, entity_ids, reason, expire, sign)

def do_logout(self, name_id, entity_ids, reason, expire, sign=None):
def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
expected_binding=None):
"""

:param name_id: Identifier of the Subject (a NameID instance)
Expand All @@ -126,6 +127,8 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None):
:param reason: The reason for doing the logout
:param expire: Try to logout before this time.
:param sign: Whether to sign the request or not
:param expected_binding: Specify the expected binding then not try it
all
:return:
"""
# check time
Expand All @@ -142,6 +145,8 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None):
# for all where I can use the SOAP binding, do those first
for binding in [BINDING_SOAP, BINDING_HTTP_POST,
BINDING_HTTP_REDIRECT]:
if expected_binding and binding != expected_binding:
continue
try:
srvs = self.metadata.single_logout_service(entity_id,
binding,
Expand Down