From: Matías Aguirre Date: Sun, 6 Mar 2011 14:49:42 +0000 (-0200) Subject: Migration to OAuth2 lib. Closes gh-37. Closes gh-28. Closes gh-31. X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=ab8ce75c9c737963e2e7186826167bd60a6eb1f0;p=django-social-auth.git Migration to OAuth2 lib. Closes gh-37. Closes gh-28. Closes gh-31. --- diff --git a/README.rst b/README.rst index 900e45e..73252c4 100644 --- a/README.rst +++ b/README.rst @@ -469,6 +469,10 @@ Attributions to whom deserves: - LinkedIn support +- micrypt_ (Seyi Ogunyemi) + + - OAuth2 migration + ---------- Copyrights @@ -527,3 +531,4 @@ Base work is copyrighted by: .. _alfredo: https://github.com/alfredo .. _mattucf: https://github.com/mattucf .. _Quard: https://github.com/Quard +.. _micrypt: https://github.com/micrypt diff --git a/example/app/views.py b/example/app/views.py index c810726..a17a0cf 100644 --- a/example/app/views.py +++ b/example/app/views.py @@ -21,7 +21,6 @@ def done(request): """Login complete view, displays user data""" names = request.user.social_auth.values_list('provider', flat=True) ctx = dict((name.lower().replace('-', '_'), True) for name in names) - print ctx ctx['version'] = version return render_to_response('done.html', ctx, RequestContext(request)) diff --git a/setup.py b/setup.py index b1c2281..cab3e9b 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ setup(name='django-social-auth', 'social_auth.backends.contrib'], long_description=long_description(), install_requires=['django>=1.2', - 'oauth>=1.0', + 'oauth2>=1.5.167', 'python_openid>=2.2'], classifiers=['Framework :: Django', 'Development Status :: 4 - Beta', diff --git a/social_auth/backends/__init__.py b/social_auth/backends/__init__.py index dee1770..fa482bb 100644 --- a/social_auth/backends/__init__.py +++ b/social_auth/backends/__init__.py @@ -17,8 +17,10 @@ from openid.consumer.consumer import Consumer, SUCCESS, CANCEL, FAILURE from openid.consumer.discover import DiscoveryFailure from openid.extensions import sreg, ax -from oauth2 import Consumer as OAuthConsumer, Token as OAuthToken, Request as OAuthRequest, \ - SignatureMethod_HMAC_SHA1 as OAuthSignatureMethod_HMAC_SHA1 +from oauth2 import Consumer as OAuthConsumer, \ + Token as OAuthToken, \ + Request as OAuthRequest, \ + SignatureMethod_HMAC_SHA1 as OAuthSignatureMethod_HMAC_SHA1 from django.conf import settings from django.contrib.auth import authenticate