From 9cc63eb2aae97e9c82d11cc2229c37c5cc39f2b1 Mon Sep 17 00:00:00 2001 From: Alexander Schrijver Date: Mon, 11 May 2020 11:18:11 +0200 Subject: [PATCH] Add the ability to change the ProtocolBinding in the authn request. --- src/onelogin/saml2/authn_request.py | 1 + src/onelogin/saml2/xml_templates.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/onelogin/saml2/authn_request.py b/src/onelogin/saml2/authn_request.py index 48ad9d2a..c0ced249 100644 --- a/src/onelogin/saml2/authn_request.py +++ b/src/onelogin/saml2/authn_request.py @@ -124,6 +124,7 @@ def __init__(self, settings, force_authn=False, is_passive=False, set_nameid_pol 'nameid_policy_str': nameid_policy_str, 'requested_authn_context_str': requested_authn_context_str, 'attr_consuming_service_str': attr_consuming_service_str, + 'acs_binding': sp_data['assertionConsumerService'].get('binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST') } self.__authn_request = request diff --git a/src/onelogin/saml2/xml_templates.py b/src/onelogin/saml2/xml_templates.py index 306b1afe..5575d116 100644 --- a/src/onelogin/saml2/xml_templates.py +++ b/src/onelogin/saml2/xml_templates.py @@ -27,7 +27,7 @@ class OneLogin_Saml2_Templates(object): Version="2.0"%(provider_name)s%(force_authn_str)s%(is_passive_str)s IssueInstant="%(issue_instant)s" Destination="%(destination)s" - ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" + ProtocolBinding="%(acs_binding)s" AssertionConsumerServiceURL="%(assertion_url)s"%(attr_consuming_service_str)s> %(entity_id)s%(subject_str)s%(nameid_policy_str)s %(requested_authn_context_str)s