[Python-modules-commits] [python-social-auth] 07/15: Minor cleanups
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:13:34 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag v0.2.11
in repository python-social-auth.
commit 02ab628b8961b969021de87aeb23551da4e751b7
Author: Braden MacDonald <braden at opencraft.com>
Date: Thu May 21 12:08:10 2015 -0700
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 c6ea5c9..0ea11c0 100644
--- a/social/backends/saml.py
+++ b/social/backends/saml.py
@@ -75,11 +75,6 @@ class SAMLIdentityProvider(object):
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 """
return self.conf['x509cert']
@@ -91,7 +86,7 @@ class SAMLIdentityProvider(object):
"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 @@ class SAMLAuth(BaseAuth):
"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 @@ class SAMLAuth(BaseAuth):
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 5c119e6..3f61010 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"
}
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git
More information about the Python-modules-commits
mailing list