]> git.parisson.com Git - django-social-auth.git/commitdiff
Make AUTH_BACKEND a mandatory attribute
authorMatías Aguirre <matiasaguirre@gmail.com>
Wed, 16 Feb 2011 01:08:12 +0000 (23:08 -0200)
committerMatías Aguirre <matiasaguirre@gmail.com>
Wed, 16 Feb 2011 01:08:12 +0000 (23:08 -0200)
social_auth/backends/__init__.py
social_auth/backends/facebook.py
social_auth/backends/google.py

index 2e523137d69559a1cf0cbeeef15b0425b3edb017..0e5e31a09a5f03132b795d9ff1ace35188c71239 100644 (file)
@@ -260,7 +260,12 @@ class OpenIDBackend(SocialAuthBackend):
 
 class BaseAuth(object):
     """Base authentication class, new authenticators should subclass
-    and implement needed methods"""
+    and implement needed methods.
+
+        @AUTH_BACKEND   Authorization backend related with this service
+    """
+    AUTH_BACKEND = None
+
     def __init__(self, request, redirect):
         self.request = request
         self.data = request.POST if request.method == 'POST' else request.GET
@@ -297,10 +302,7 @@ class BaseAuth(object):
 
 
 class OpenIdAuth(BaseAuth):
-    """
-    OpenId process handling
-        @AUTH_BACKEND   Authorization backend related with this service
-    """
+    """OpenId process handling"""
     AUTH_BACKEND = OpenIDBackend
 
     def auth_url(self):
@@ -406,14 +408,11 @@ class ConsumerBasedOAuth(BaseOAuth):
         @REQUEST_TOKEN_URL       Request token URL
         @ACCESS_TOKEN_URL        Access token URL
         @SERVER_URL              Authorization server URL
-        @AUTH_BACKEND            Authorization backend related with
-                                 this service
     """
     AUTHORIZATION_URL = ''
     REQUEST_TOKEN_URL = ''
     ACCESS_TOKEN_URL = ''
     SERVER_URL = ''
-    AUTH_BACKEND = None
     SETTINGS_KEY_NAME = ''
     SETTINGS_SECRET_NAME = ''
 
index b397b5714d52e3a5208af15b418e4c87000c7737..6ed3752535feb314182719cc9ac7bb3d859fb4cc 100644 (file)
@@ -40,6 +40,8 @@ class FacebookBackend(OAuthBackend):
 
 class FacebookAuth(BaseOAuth):
     """Facebook OAuth mechanism"""
+    AUTH_BACKEND = FacebookBackend
+
     def auth_url(self):
         """Returns redirect url"""
         args = {'client_id': settings.FACEBOOK_APP_ID,
index ac4a1dff233b752d2b310018aa8535216cb3011c..292ff36b6590a41cf18da7e9f56ac123ea963fd5 100644 (file)
@@ -71,7 +71,6 @@ class BaseGoogleOAuth(ConsumerBasedOAuth):
     REQUEST_TOKEN_URL = GOOGLE_REQUEST_TOKEN_URL
     ACCESS_TOKEN_URL = GOOGLE_ACCESS_TOKEN_URL
     SERVER_URL = GOOGLE_SERVER
-    AUTH_BACKEND = None
 
     def user_data(self, access_token):
         """Loads user data from G service"""