]> git.parisson.com Git - django-social-auth.git/commitdiff
Rename GOOGLE_OAUTH2_CLIENT_KEY to GOOGLE_OAUTH2_CLIENT_ID, keep backward compatibili...
authorMatías Aguirre <matiasaguirre@gmail.com>
Fri, 26 Aug 2011 02:54:21 +0000 (23:54 -0300)
committerMatías Aguirre <matiasaguirre@gmail.com>
Fri, 26 Aug 2011 02:54:21 +0000 (23:54 -0300)
README.rst
doc/backends/google.rst
doc/configuration.rst
example/local_settings.py.template
social_auth/backends/google.py

index 5017de1c3884dbbcf846493768fe885cd5149e41..3feeeac019a213671daeee200b52cb1267b237cf 100644 (file)
@@ -148,7 +148,7 @@ Configuration
     ORKUT_CONSUMER_SECRET        = ''
     GOOGLE_CONSUMER_KEY          = ''
     GOOGLE_CONSUMER_SECRET       = ''
-    GOOGLE_OAUTH2_CLIENT_KEY     = ''
+    GOOGLE_OAUTH2_CLIENT_ID      = ''
     GOOGLE_OAUTH2_CLIENT_SECRET  = ''
     FOURSQUARE_CONSUMER_KEY      = ''
     FOURSQUARE_CONSUMER_SECRET   = ''
@@ -512,12 +512,11 @@ To enable OAuth2 support:
 - fill ``Client ID`` and ``Client Secret`` settings, these values can be obtained
   easily as described on `OAuth2 Registering`_ doc::
 
-      GOOGLE_OAUTH2_CLIENT_KEY = ''
+      GOOGLE_OAUTH2_CLIENT_ID = ''
       GOOGLE_OAUTH2_CLIENT_SECRET = ''
 
-  Take into account that ``GOOGLE_OAUTH2_CLIENT_KEY`` is the value referred as
-  ``Client ID`` on Google's doc, but ``django-social-auth`` uses ``*_KEY``
-  terminology on all backends to keep it consistent.
+  previous name ``GOOGLE_OAUTH2_CLIENT_KEY`` is supported for backward
+  compatibility.
 
 - scopes are shared between OAuth mechanisms::
 
index eafd856cc3b9d7bd0105686b2fe80d36650ec646..c3cbcfdcca0fbcec1a0268f3b751fe954aed825c 100644 (file)
@@ -52,12 +52,11 @@ To enable OAuth2 support:
 - fill ``Client ID`` and ``Client Secret`` settings, these values can be obtained
   easily as described on `OAuth2 Registering`_ doc::
 
-      GOOGLE_OAUTH2_CLIENT_KEY = ''
+      GOOGLE_OAUTH2_CLIENT_ID = ''
       GOOGLE_OAUTH2_CLIENT_SECRET = ''
 
-  Take into account that ``GOOGLE_OAUTH2_CLIENT_KEY`` is the value referred as
-  ``Client ID`` on Google's doc, but ``django-social-auth`` uses ``*_KEY``
-  terminology on all backends to keep it consistent.
+  previous name ``GOOGLE_OAUTH2_CLIENT_KEY`` is supported for backward
+  compatibility.
 
 - scopes are shared between OAuth mechanisms::
 
index 4c2cc1f1edbc8fc055155f0dcdcde3d04ddb2e51..7ed85fb318d42f0b98712732b69ee2225e981278 100644 (file)
@@ -55,7 +55,7 @@ Configuration
     ORKUT_CONSUMER_SECRET        = ''
     GOOGLE_CONSUMER_KEY          = ''
     GOOGLE_CONSUMER_SECRET       = ''
-    GOOGLE_OAUTH2_CLIENT_KEY     = ''
+    GOOGLE_OAUTH2_CLIENT_ID      = ''
     GOOGLE_OAUTH2_CLIENT_SECRET  = ''
     FOURSQUARE_CONSUMER_KEY      = ''
     FOURSQUARE_CONSUMER_SECRET   = ''
index 8b52a3b7bce763a3bf80d0523b20105b6a9fb086..6e733b419cdf001006a8a126db451b974aa0bf9c 100644 (file)
@@ -6,7 +6,7 @@ LINKEDIN_CONSUMER_KEY             = ''
 LINKEDIN_CONSUMER_SECRET          = ''
 ORKUT_CONSUMER_KEY                = ''
 ORKUT_CONSUMER_SECRET             = ''
-GOOGLE_OAUTH2_CLIENT_KEY          = ''
+GOOGLE_OAUTH2_CLIENT_ID           = ''
 GOOGLE_OAUTH2_CLIENT_SECRET       = ''
 SOCIAL_AUTH_CREATE_USERS          = True
 SOCIAL_AUTH_FORCE_RANDOM_USERNAME = False
@@ -16,4 +16,6 @@ LOGIN_ERROR_URL                   = '/login/error/'
 #SOCIAL_AUTH_USER_MODEL            = 'app.CustomUser'
 SOCIAL_AUTH_ERROR_KEY             = 'socialauth_error'
 GITHUB_APP_ID                     = ''
-GITHUB_API_SECRET                 = ''
\ No newline at end of file
+GITHUB_API_SECRET                 = ''
+FOURSQUARE_CONSUMER_KEY           = ''
+FOURSQUARE_CONSUMER_SECRET        = ''
index 955012119834f3ed5019f4819f203e61fe84b6d4..52f701f12cdce3a70e38278d012a210cea2af7d8 100644 (file)
@@ -141,12 +141,18 @@ class GoogleOAuth(BaseGoogleOAuth):
         return True
 
 
+# TODO: Remove this setting name check, keep for backward compatibility
+_OAUTH2_KEY_NAME = hasattr(settings, 'GOOGLE_OAUTH2_CLIENT_ID') and \
+                   'GOOGLE_OAUTH2_CLIENT_ID' or \
+                   'GOOGLE_OAUTH2_CLIENT_KEY'
+
+
 class GoogleOAuth2(BaseOAuth2):
     """Google OAuth2 support"""
     AUTH_BACKEND = GoogleOAuth2Backend
     AUTHORIZATION_URL = 'https://accounts.google.com/o/oauth2/auth'
     ACCESS_TOKEN_URL = 'https://accounts.google.com/o/oauth2/token'
-    SETTINGS_KEY_NAME = 'GOOGLE_OAUTH2_CLIENT_KEY'
+    SETTINGS_KEY_NAME = _OAUTH2_KEY_NAME
     SETTINGS_SECRET_NAME = 'GOOGLE_OAUTH2_CLIENT_SECRET'
 
     def get_scope(self):