]> git.parisson.com Git - django-social-auth.git/commitdiff
Preparing for merge with main branch - cleaning up old merge differences
authorStas Kravets <krvss@mail.ru>
Wed, 9 May 2012 11:21:37 +0000 (15:21 +0400)
committerStas Kravets <krvss@mail.ru>
Wed, 9 May 2012 11:21:37 +0000 (15:21 +0400)
README.rst
doc/backends/google.rst
doc/backends/vkontakte.rst
doc/configuration.rst
example/app/views.py
requirements.txt
setup.py
social_auth/views.py

index ba61ec3175418e6de856deaf1939d82a2f22de51..2fddd117f8eb6a234d4c8abf75c99bd72763459d 100644 (file)
@@ -10,11 +10,8 @@ third parties.
 
 You can check this documentation on `Read the Docs`_ too.
 
-For Russian services backends (Yandex, Mail.ru, etc.) see http://www.ikrvss.ru/tag/django-social-auth/
-
 .. contents:: Table of Contents
 
-
 Demo
 ----
 
@@ -52,6 +49,8 @@ credentials, some features are:
     * `Skyrock OAuth`_
     * `Yahoo OAuth`_
     * `Evernote OAuth`_
+    * `Mail.ru OAuth`_
+    * `Odnoklassniki OAuth`_
 
 - Basic user data population and signaling, to allows custom fields values
   from providers response
@@ -955,6 +954,11 @@ Vkontakte uses OAuth v2 for Authentication
 
   See the `names of the privileges VKontakte`_.
 
+You can also use Vkontakte's own OpenAPI to log in, but you need to provide a HTML template
+with JavaScript code to authenticate. See vkontakte.html in templates folder for details.
+
+To support authentication for VKontakte applications see `authentication for VKontakte applications`_.
+
 MSN Live Connect
 ^^^^^^^^^^^^^^^^
 
@@ -1012,6 +1016,33 @@ Evernote OAuth 1.0 workflow.
       EVERNOTE_CONSUMER_KEY = ''
       EVERNOTE_CONSUMER_SECRET = ''
 
+Yandex OAuth and OpenID
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Yandex uses OAuth 2.0 workflow, fill and YANDEX_APP_ID and YANDEX_API_SECRET settings to log in.
+Currently there are 2 backends for Yandex, one is Yaru to log in using Ya.ru service and another one is
+YandexOAuth that could use service API from settings. Use YANDEX_OAUTH2_API_URL to set up which service to use.
+Tested with 'https://api-yaru.yandex.ru/me/' for Ya.ru and 'http://api.moikrug.ru/v1/my/' for Moi Krug.
+
+Yandex also uses OpenID 2.0. You do not need to provide user's name because Yandex will do it for you.
+
+Mail.ru OAuth
+^^^^^^^^^^^^^
+
+Mail.ru uses OAuth2 workflow, to use it fill in settings
+
+MAILRU_OAUTH2_CLIENT_KEY                 = ''
+MAILRU_OAUTH2_APP_KEY                    = ''
+MAILRU_OAUTH2_CLIENT_SECRET       = ''
+
+Odnoklassniki.ru
+^^^^^^^^^^^^^^^^
+
+Odnoklassniki.ru uses OAuth2 workflow, to use it fill in settings
+
+ODNOKLASSNIKI_OAUTH2_CLIENT_KEY    = ''
+ODNOKLASSNIKI_OAUTH2_APP_KEY       = ''
+ODNOKLASSNIKI_OAUTH2_CLIENT_SECRET = ''
 
 Testing
 -------
@@ -1158,6 +1189,10 @@ Attributions to whom deserves:
 - krvss_ (Stas Kravets):
 
   - Initial setup.py configuration
+  - LiveJournal support
+  - Mail.ru, Odnoklassniki support
+  - Yandex OpenID support
+  - VKontakte OpenAPI support
 
 - jezdez_ (Jannis Leidel):
 
@@ -1311,3 +1346,6 @@ Base work is copyrighted by:
 .. _Yahoo Developer Center: https://developer.apps.yahoo.com/projects/
 .. _Evernote API Key form: http://dev.evernote.com/support/api_key.php
 .. _hassek: https://github.com/hassek
+.. _Mail.ru OAuth: http://api.mail.ru/docs/guides/oauth/
+.. _Odnoklassniki OAuth: http://dev.odnoklassniki.ru/wiki/display/ok/The+OAuth+2.0+Protocol
+.. _authentication for VKontakte applications: http://www.ikrvss.ru/2011/11/08/django-social-auh-and-vkontakte-application/
\ No newline at end of file
index 65d3b1f48b57fd1f433a0b60fc040116a05b5ca8..eef96766e2d106bce5b3b17226a102c47d2e39b9 100644 (file)
@@ -87,16 +87,6 @@ Configurable settings:
     GOOGLE_WHITE_LISTED_EMAILS = ['me@mygoogleappsdomain.com', 'you@gmail.com']
 
 
-Google OpenID 
--------------
-
-Configurable settings:
-
-- Supply a list of domain strings to be checked. The default (empty list) allows all domains.  If a list is provided and a user attempts to sign in with a Google account that is not in the list, then a ValueError will be raised and the user will be redirected to your login error page::
-
-    GOOGLE_WHITE_LISTED_DOMAINS = ['mydomain.com']
-
-
 Orkut
 -----
 
index a11a422553a19c2eee367153f1ab3440463bab94..6916fc2b199c35027cb2dcc35f04b966e9705263 100644 (file)
@@ -15,6 +15,12 @@ Vkontakte uses OAuth v2 for Authentication
 
   See the `names of the privileges VKontakte`_.
 
+You can also use Vkontakte's own OpenAPI to log in, but you need to provide HTML template
+with JavaScript code to authenticate. See vkontakte.html in templates folder for details.
+
+To support authentication for VKontakte applications see `authentication for VKontakte applications`_
+
 .. _Vkontakte OAuth: http://vk.com/developers.php?oid=-1&p=%D0%90%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F_%D1%81%D0%B0%D0%B9%D1%82%D0%BE%D0%B2
 .. _names of the privileges VKontakte: http://vk.com/developers.php?oid=-1&p=%D0%9F%D1%80%D0%B0%D0%B2%D0%B0_%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%B0_%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B9
 .. _Vkontakte API: http://vk.com/developers.php
+.. _authentication for VKontakte applications: http://www.ikrvss.ru/2011/11/08/django-social-auh-and-vkontakte-application/
\ No newline at end of file
index 86c91705ab687b8a581cb315b881c01ad79639e0..532b0a01117e99badc81f488a6a352cede783b49 100644 (file)
@@ -296,14 +296,6 @@ uppercase and replace ``-`` with ``_``), here's the supported settings so far::
         SOCIAL_AUTH_LOGIN_REDIRECT_URL
         SOCIAL_AUTH_INACTIVE_USER_URL
 
-- The app catches any exception and logs errors to ``logger`` or
-  ``django.contrib.messagess`` app. Having tracebacks is really useful when
-  debugging, for that purpose this setting was defined::
-
-    SOCIAL_AUTH_RAISE_EXCEPTIONS = DEBUG
-
-  It's default value is ``DEBUG``, so you need to set it to ``False`` to avoid
-  tracebacks when ``DEBUG = True``.
 
 .. _Model Manager: http://docs.djangoproject.com/en/dev/topics/db/managers/#managers
 .. _Login URL: http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#login-url
index a201377151a756d105808cfe9890167802bf91be..3c100643a67340b3405611be7d33753afb3abdf2 100644 (file)
@@ -8,6 +8,7 @@ from django.contrib.messages.api import get_messages
 from social_auth import __version__ as version
 from social_auth.utils import setting
 
+
 def home(request):
     """Home view, displays login mechanism"""
     if request.user.is_authenticated():
index fc5acbfb737fdfceb32f7d62126b97f5cfc76803..83696366b848faed85d3de54c9fbd8f517123666 100644 (file)
@@ -1,2 +1,3 @@
+django>=1.2.5
 oauth2>=1.5.167
 python_openid>=2.2
index 0a93d40788d8cc8f08a19a4431a0f3ce6bd7f979..d062c089921ff0db92ea9ca90885680613e7a0f8 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -39,9 +39,10 @@ setup(name='django-social-auth',
                 'social_auth.backends.pipeline'],
       package_data={'social_auth':['locale/*/LC_MESSAGES/*']},
       long_description=long_description(),
-      install_requires=['oauth2>=1.5.167',
+      install_requires=['django>=1.2.5',
+                        'oauth2>=1.5.167',
                         'python_openid>=2.2'],
-      classifiers=['Framework :: Django',
+    classifiers=['Framework :: Django',
                    'Development Status :: 4 - Beta',
                    'Topic :: Internet',
                    'License :: OSI Approved :: BSD License',
index f9ff07f8eb2197752ece30f30371044bbfb31883..13bd3308004ad3dd894f997eeeb954ecba5e033e 100644 (file)
@@ -11,12 +11,12 @@ from django.contrib.auth.decorators import login_required
 from django.contrib import messages
 from django.views.decorators.csrf import csrf_exempt
 
-from social_auth.utils import sanitize_redirect, setting,\
-    backend_setting, clean_partial_pipeline
+from social_auth.utils import sanitize_redirect, setting, \
+                              backend_setting, clean_partial_pipeline
 from social_auth.decorators import dsa_view
 
 
-DEFAULT_REDIRECT = setting('SOCIAL_AUTH_LOGIN_REDIRECT_URL') or\
+DEFAULT_REDIRECT = setting('SOCIAL_AUTH_LOGIN_REDIRECT_URL') or \
                    setting('LOGIN_REDIRECT_URL')
 LOGIN_ERROR_URL = setting('LOGIN_ERROR_URL', setting('LOGIN_URL'))
 
@@ -51,8 +51,8 @@ def associate_complete(request, backend, *args, **kwargs):
         return user
     else:
         url = backend_setting(backend,
-            'SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL') or\
-              redirect_value or\
+                              'SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL') or \
+              redirect_value or \
               DEFAULT_REDIRECT
     return HttpResponseRedirect(url)
 
@@ -62,8 +62,8 @@ def associate_complete(request, backend, *args, **kwargs):
 def disconnect(request, backend, association_id=None):
     """Disconnects given backend from current logged in user."""
     backend.disconnect(request.user, association_id)
-    url = request.REQUEST.get(REDIRECT_FIELD_NAME, '') or\
-          backend_setting(backend, 'SOCIAL_AUTH_DISCONNECT_REDIRECT_URL') or\
+    url = request.REQUEST.get(REDIRECT_FIELD_NAME, '') or \
+          backend_setting(backend, 'SOCIAL_AUTH_DISCONNECT_REDIRECT_URL') or \
           DEFAULT_REDIRECT
     return HttpResponseRedirect(url)
 
@@ -86,7 +86,7 @@ def auth_process(request, backend):
         return HttpResponseRedirect(backend.auth_url())
     else:
         return HttpResponse(backend.auth_html(),
-            content_type='text/html;charset=UTF-8')
+                            content_type='text/html;charset=UTF-8')
 
 
 def complete_process(request, backend, *args, **kwargs):
@@ -108,7 +108,7 @@ def complete_process(request, backend, *args, **kwargs):
             # in authenticate process
             social_user = user.social_user
             if redirect_value:
-                request.session[REDIRECT_FIELD_NAME] = redirect_value or\
+                request.session[REDIRECT_FIELD_NAME] = redirect_value or \
                                                        DEFAULT_REDIRECT
 
             if setting('SOCIAL_AUTH_SESSION_EXPIRATION', True):
@@ -120,23 +120,23 @@ def complete_process(request, backend, *args, **kwargs):
 
             # store last login backend name in session
             key = setting('SOCIAL_AUTH_LAST_LOGIN',
-                'social_auth_last_login_backend')
+                          'social_auth_last_login_backend')
             request.session[key] = social_user.provider
 
             # Remove possible redirect URL from session, if this is a new
             # account, send him to the new-users-page if defined.
             new_user_redirect = backend_setting(backend,
-                'SOCIAL_AUTH_NEW_USER_REDIRECT_URL')
+                                           'SOCIAL_AUTH_NEW_USER_REDIRECT_URL')
             if new_user_redirect and getattr(user, 'is_new', False):
                 url = new_user_redirect
             else:
-                url = redirect_value or\
+                url = redirect_value or \
                       backend_setting(backend,
-                          'SOCIAL_AUTH_LOGIN_REDIRECT_URL') or\
+                                      'SOCIAL_AUTH_LOGIN_REDIRECT_URL') or \
                       DEFAULT_REDIRECT
         else:
             url = backend_setting(backend, 'SOCIAL_AUTH_INACTIVE_USER_URL',
-                LOGIN_ERROR_URL)
+                                  LOGIN_ERROR_URL)
     else:
         msg = setting('LOGIN_ERROR_MESSAGE', None)
         if msg:
@@ -154,9 +154,9 @@ def auth_complete(request, backend, user=None, *args, **kwargs):
     if request.session.get(name):
         data = request.session.pop(name)
         idx, args, kwargs = backend.from_session_dict(data, user=user,
-            request=request,
-            *args, **kwargs)
+                                                      request=request,
+                                                      *args, **kwargs)
         return backend.continue_pipeline(pipeline_index=idx, *args, **kwargs)
     else:
         return backend.auth_complete(user=user, request=request, *args,
-            **kwargs)
\ No newline at end of file
+                                     **kwargs)