Skip to content

Commit 788a695

Browse files
committed
Pass sign information when calling apply_binding
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 3989b99 commit 788a695

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/saml2/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def prepare_for_negotiated_authenticate(
125125
args = {}
126126

127127
http_info = self.apply_binding(binding, _req_str, destination,
128-
relay_state, **args)
128+
relay_state, sign=sign, **args)
129129

130130
return reqid, binding, http_info
131131
else:
@@ -240,7 +240,7 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
240240
relay_state = self._relay_state(req_id)
241241

242242
http_info = self.apply_binding(binding, srequest, destination,
243-
relay_state, sigalg=sigalg)
243+
relay_state, sign=sign, sigalg=sigalg)
244244

245245
if binding == BINDING_SOAP:
246246
response = self.send(**http_info)
@@ -478,7 +478,7 @@ def do_attribute_query(self, entityid, subject_id,
478478
"sign": sign}
479479
relay_state = self._relay_state(query.id)
480480
return self.apply_binding(binding, "%s" % query, destination,
481-
relay_state)
481+
relay_state, sign=sign)
482482
else:
483483
raise SAMLError("Unsupported binding")
484484

@@ -535,4 +535,4 @@ def handle_logout_request(self, request, name_id, binding, sign=False,
535535

536536
return self.apply_binding(rinfo["binding"], response,
537537
rinfo["destination"], relay_state,
538-
response=True)
538+
response=True, sign=sign)

src/saml2/s2repoze/plugins/sp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,11 @@ def challenge(self, environ, _status, _app_headers, _forget_headers):
368368
self.outstanding_certs[_sid] = cert
369369

370370
ht_args = _cli.apply_binding(
371-
_binding, msg_str, destination=dest, relay_state=came_from
371+
_binding,
372+
msg_str,
373+
destination=dest,
374+
relay_state=came_from,
375+
sign=_cli.authn_requests_signed,
372376
)
373377

374378
logger.debug("ht_args: %s", ht_args)

tests/test_51_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ def test_signed_redirect(self):
13751375

13761376
info = self.client.apply_binding(
13771377
BINDING_HTTP_REDIRECT, msg_str, destination="",
1378-
relay_state="relay2", sigalg=SIG_RSA_SHA256)
1378+
relay_state="relay2", sign=True, sigalg=SIG_RSA_SHA256)
13791379

13801380
loc = info["headers"][0][1]
13811381
qs = parse_qs(loc[1:])
@@ -2875,7 +2875,7 @@ def test_signed_redirect(self):
28752875

28762876
info = self.client.apply_binding(
28772877
BINDING_HTTP_REDIRECT, msg_str, destination="",
2878-
relay_state="relay2", sigalg=SIG_RSA_SHA256)
2878+
relay_state="relay2", sign=True, sigalg=SIG_RSA_SHA256)
28792879

28802880
loc = info["headers"][0][1]
28812881
qs = parse_qs(loc[1:])

0 commit comments

Comments
 (0)