[Python-modules-commits] [python-social-auth] 04/61: echosign OAuth2 backend
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:14:01 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag v0.2.13
in repository python-social-auth.
commit 6e2484d43c1e6ee153143f1dc1bcc8c76a0b9cfa
Author: paxapy <paxapy at gmail.com>
Date: Fri Jul 10 20:52:21 2015 +0300
echosign OAuth2 backend
---
social/backends/echosign.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/social/backends/echosign.py b/social/backends/echosign.py
new file mode 100644
index 0000000..15c6887
--- /dev/null
+++ b/social/backends/echosign.py
@@ -0,0 +1,24 @@
+from social.backends.oauth import BaseOAuth2
+
+
+class EchosignOAuth2(BaseOAuth2):
+ name = 'echosign'
+ REDIRECT_STATE = False
+ ACCESS_TOKEN_METHOD = 'POST'
+ REFRESH_TOKEN_METHOD = 'POST'
+ REVOKE_TOKEN_METHOD = 'POST'
+ AUTHORIZATION_URL = 'https://secure.echosign.com/public/oauth'
+ ACCESS_TOKEN_URL = 'https://secure.echosign.com/oauth/token'
+ REFRESH_TOKEN_URL = 'https://secure.echosign.com/oauth/refresh'
+ REVOKE_TOKEN_URL = 'https://secure.echosign.com/oauth/revoke'
+
+ def get_user_details(self, response):
+ return response
+
+ def get_user_id(self, details, response):
+ return details['userInfoList'][0]['userId']
+
+ def user_data(self, access_token, *args, **kwargs):
+ return self.get_json(
+ 'https://api.echosign.com/api/rest/v3/users',
+ headers={'Access-Token': access_token})
--
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