Permalink
Browse files

Merge branch 'master' of github.com:omab/django-social-auth

  • Loading branch information...
2 parents 5a1ecda + df51f5b commit 0439e1c9afe6d4fc9f501503a6cc9883e663834f @omab committed Oct 10, 2012
@@ -19,7 +19,6 @@
from oauth2 import Consumer as OAuthConsumer, Token, Request as OAuthRequest
from django.contrib.auth import authenticate
-from django.contrib.auth.backends import ModelBackend
from django.utils import simplejson
from django.utils.importlib import import_module
@@ -78,7 +77,7 @@
))
-class SocialAuthBackend(ModelBackend):
+class SocialAuthBackend(object):
"""A django.contrib.auth backend that authenticates the user based on
a authentication provider response"""
name = '' # provider name, it's stored in database
@@ -75,7 +75,9 @@ def auth_complete(self, *args, **kwargs):
class DoubanBackend2(OAuthBackend):
"""Douban OAuth authentication backend"""
name = 'douban2'
- EXTRA_DATA = [('id', 'id')]
+ EXTRA_DATA = [('id', 'id'),
+ ('uid', 'username'),
+ ]
def get_user_id(self, details, response):
return response['id']
@@ -32,6 +32,7 @@ class WeiboBackend(OAuthBackend):
# Default extra data to store
EXTRA_DATA = [
('id', 'id'),
+ ('name', 'username'),
('profile_image_url', 'profile_image_url'),
('gender', 'gender')
]
@@ -93,6 +93,7 @@ class YaruAuth(BaseOAuth2):
AUTHORIZATION_URL = YANDEX_AUTHORIZATION_URL
ACCESS_TOKEN_URL = YANDEX_ACCESS_TOKEN_URL
AUTH_BACKEND = YaruBackend
+ REDIRECT_STATE = False
SERVER_URL = YANDEX_SERVER
SETTINGS_KEY_NAME = 'YANDEX_APP_ID'
SETTINGS_SECRET_NAME = 'YANDEX_API_SECRET'

0 comments on commit 0439e1c

Please sign in to comment.