@@ -117,7 +117,8 @@ def global_logout(self, name_id, reason="", expire=None, sign=None):
117
117
entity_ids = self .users .issuers_of_info (name_id )
118
118
return self .do_logout (name_id , entity_ids , reason , expire , sign )
119
119
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 ):
121
122
"""
122
123
123
124
: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):
126
127
:param reason: The reason for doing the logout
127
128
:param expire: Try to logout before this time.
128
129
:param sign: Whether to sign the request or not
130
+ :param expected_binding: Specify the expected binding then not try it
131
+ all
129
132
:return:
130
133
"""
131
134
# check time
@@ -142,6 +145,8 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None):
142
145
# for all where I can use the SOAP binding, do those first
143
146
for binding in [BINDING_SOAP , BINDING_HTTP_POST ,
144
147
BINDING_HTTP_REDIRECT ]:
148
+ if expected_binding and binding != expected_binding :
149
+ continue
145
150
try :
146
151
srvs = self .metadata .single_logout_service (entity_id ,
147
152
binding ,
0 commit comments