From 8493545b1f1ab6dcdeda3350bc36fd89efbf53bf Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Thu, 21 May 2015 12:08:10 -0700 Subject: [PATCH] Minor cleanups --- social/backends/saml.py | 13 ++++--------- social/tests/backends/data/saml_config.json | 5 +---- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/social/backends/saml.py b/social/backends/saml.py index 3cdad4979..dea6c99e3 100644 --- a/social/backends/saml.py +++ b/social/backends/saml.py @@ -74,11 +74,6 @@ def sso_url(self): """ Get the SSO URL for this IdP """ return self.conf['url'] # Required. e.g. "https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO" - @property - def sso_binding(self): - """ Get the method used to submit our request to the SSO URL """ - return self.conf.get('binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect') - @property def x509cert(self): """ X.509 Public Key Certificate for this IdP """ @@ -91,7 +86,7 @@ def saml_config_dict(self): "entityId": self.entity_id, "singleSignOnService": { "url": self.sso_url, - "binding": self.sso_binding, + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", # python-saml only supports Redirect }, "x509cert": self.x509cert, } @@ -174,7 +169,7 @@ def generate_saml_config(self, idp): "sp": { "assertionConsumerService": { "url": abs_completion_url, - "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", + "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", # python-saml only supports HTTP-POST }, "entityId": self.setting("SP_ENTITY_ID"), "NameIDFormats": self.setting("SP_NAMEID_FORMATS", []), @@ -231,8 +226,8 @@ def auth_url(self): idp_name = self.strategy.request_data()['idp'] auth = self._create_saml_auth(idp=self.get_idp(idp_name)) # Below, return_to sets the RelayState, which can contain arbitrary data. - # We use it to store the specific SAML IdP backend name, since we combine - # many backends to a single URL. + # We use it to store the specific SAML IdP name, since we multiple IdPs + # share the same auth_complete URL. return auth.login(return_to=idp_name) def get_user_details(self, response): diff --git a/social/tests/backends/data/saml_config.json b/social/tests/backends/data/saml_config.json index 5c119e6a7..3f610107c 100644 --- a/social/tests/backends/data/saml_config.json +++ b/social/tests/backends/data/saml_config.json @@ -17,10 +17,7 @@ }, "other": { "entity_id": "https://unused.saml.example.com", - "singleSignOnService": { - "url": "https://unused.saml.example.com/SAML2/Redirect/SSO", - "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" - } + "url": "https://unused.saml.example.com/SAML2/Redirect/SSO" } } }