omab / django-social-auth

Django social authentication made simple
https://groups.google.com/group/django-social-auth
BSD 3-Clause "New" or "Revised" License
2.65k stars 756 forks source link

[Google-Oauth2] Django Social Auth (v0.7.9) #523

Closed some1thatNeedsHelp closed 12 years ago

some1thatNeedsHelp commented 12 years ago

Just updated to 0.7.9 - and its broken Google-Oauth2!

Again, using the example app that comes with it, click on "Google-Oauth2"

http://127.0.0.1/login/google-oauth2/

And its forwarding me to the error page

http://127.0.0.1/login/error/

saying 'Incorrect authentication service'.

Soon as I drop back to 0.7.7

git reset --hard cf72986ab3c01c1dae2c3baebd00c540fb4250d8

Everything works again....

some1thatNeedsHelp commented 12 years ago

5e25aaca2c0d523cbba69d2d965c94bf7a3e3a0c <--- when the error starts to happen cf0e512a9cec8b9c6b8d48cf522b6a07fa4ac3fe <--- as far as I can tell, the last time when Google OAuth2 worked!

git reset --hard 5e25aaca2c0d523cbba69d2d965c94bf7a3e3a0c
python manage.py runserver 0.0.0.0:80
git reset --hard cf0e512a9cec8b9c6b8d48cf522b6a07fa4ac3fe 
python manage.py runserver 0.0.0.0:80
omab commented 12 years ago

I've give a try to Google-OAuth2 backend, it worked OK, Incorrect authentication service is an error dropped when the auth backend is not defined in AUTHENTICATION_BACKENDS

some1thatNeedsHelp commented 12 years ago

Just done the follow commands, still having the same issue!

Screenshot: http://imgur.com/rnraL

Commands

[root@localhost ~]# git clone git://github.com/omab/django-social-auth.git
Initialized empty Git repository in /root/django-social-auth/.git/
remote: Counting objects: 6226, done.
remote: Compressing objects: 100% (2193/2193), done.
remote: Total 6226 (delta 4692), reused 5498 (delta 4012)
Receiving objects: 100% (6226/6226), 876.72 KiB | 806 KiB/s, done.
Resolving deltas: 100% (4692/4692), done.
[root@localhost ~]# cd django-social-auth/
[root@localhost django-social-auth]# git log | head
commit 68cdc802cc55ee68a1f480512cae25915a4f4fcd
Merge: e064aee 02c6d49
Author: Matías Aguirre <matiasaguirre@gmail.com>
Date:   Sun Nov 11 06:14:37 2012 -0800

    Merge pull request #519 from dgouldin/master

    Adding TripIt backend

commit e064aee038f1a1a3b52ac4df6af4d3097866b534
[root@localhost django-social-auth]# cd example/
[root@localhost example]# cp local_settings.py.template local_settings.py
[root@localhost example]# vi local_settings.py
[root@localhost example]# python manage.py syncdb
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table social_auth_usersocialauth
Creating table social_auth_nonce
Creating table social_auth_association
Creating table app_customuser

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): root
E-mail address: root@localhost.com
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
[root@localhost example]# grep -iR "AUTHENTICATION_BACKENDS" ../
../doc/configuration.rst:- Add desired authentication backends to Django's AUTHENTICATION_BACKENDS_ setting::
../doc/configuration.rst:    AUTHENTICATION_BACKENDS = (
../doc/configuration.rst:  Take into account that backends **must** be defined in AUTHENTICATION_BACKENDS_
../doc/configuration.rst:.. _AUTHENTICATION_BACKENDS: http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#authentication-backends
../doc/backends/douban.rst:  into your ``AUTHENTICATION_BACKENDS``.
../doc/backends/douban.rst:  into your ``AUTHENTICATION_BACKENDS``.
../doc/backends/odnoklassnikiru.rst:  into your ``AUTHENTICATION_BACKENDS``.
../doc/backends/odnoklassnikiru.rst:  into your ``AUTHENTICATION_BACKENDS``
../doc/backends/mixcloud.rst:- Add Mixcloud backend to ``AUTHENTICATION_BACKENDS`` in settings::
../doc/backends/mixcloud.rst:    AUTHENTICATION_BACKENDS = (
../doc/backends/twilio.rst:- Add desired authentication backends to Django's ``AUTHENTICATION_BACKENDS``
../doc/backends/stripe.rst:- Add the needed backend to ``AUTHENTICATION_BACKENDS``::
../doc/backends/stripe.rst:    AUTHENTICATION_BACKENDS = (
../social_auth/backends/__init__.py:    AUTHENTICATION_BACKENDS is imported and checked for a BACKENDS
../social_auth/backends/__init__.py:        for auth_backend in setting('AUTHENTICATION_BACKENDS'):
../social_auth/backends/__init__.py:    AUTHENTICATION_BACKENDS is imported and checked for a BACKENDS
../example/settings.py:AUTHENTICATION_BACKENDS = (
Binary file ../example/settings.pyc matches
[root@localhost example]# grep "AUTHENTICATION_BACKENDS = (" settings.py -A 35 -B2
)

AUTHENTICATION_BACKENDS = (
    'social_auth.backends.twitter.TwitterBackend',
    'social_auth.backends.facebook.FacebookBackend',
    'social_auth.backends.google.GoogleOAuthBackend',
    'social_auth.backends.google.GoogleOAuth2Backend',
    'social_auth.backends.google.GoogleBackend',
    'social_auth.backends.yahoo.YahooBackend',
    'social_auth.backends.stripe.StripeBackend',
    'social_auth.backends.contrib.linkedin.LinkedinBackend',
    'social_auth.backends.contrib.skyrock.SkyrockBackend',
    'social_auth.backends.contrib.flickr.FlickrBackend',
    'social_auth.backends.contrib.instagram.InstagramBackend',
    'social_auth.backends.contrib.github.GithubBackend',
    'social_auth.backends.contrib.yandex.YandexBackend',
    'social_auth.backends.contrib.yahoo.YahooOAuthBackend',
    'social_auth.backends.contrib.foursquare.FoursquareBackend',
    'social_auth.backends.OpenIDBackend',
    'social_auth.backends.contrib.live.LiveBackend',
    'social_auth.backends.contrib.livejournal.LiveJournalBackend',
    'social_auth.backends.contrib.douban.DoubanBackend',
    'social_auth.backends.browserid.BrowserIDBackend',
    'social_auth.backends.contrib.vkontakte.VKontakteBackend',
    'social_auth.backends.contrib.yandex.YandexOAuth2Backend',
    'social_auth.backends.contrib.yandex.YaruBackend',
    'social_auth.backends.contrib.odnoklassniki.OdnoklassnikiBackend',
    'social_auth.backends.contrib.odnoklassniki.OdnoklassnikiAppBackend',
    'social_auth.backends.contrib.vkontakte.VKontakteOAuth2Backend',
    'social_auth.backends.contrib.mailru.MailruBackend',
    'social_auth.backends.contrib.dailymotion.DailymotionBackend',
    'social_auth.backends.contrib.shopify.ShopifyBackend',
    'social_auth.backends.contrib.stocktwits.StocktwitsBackend',
    'django.contrib.auth.backends.ModelBackend',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
[root@localhost example]# python manage.py runserver 0.0.0.0:80
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
Validating models...

0 errors found
Django version 1.4.2, using settings 'example.settings'
Development server is running at http://0.0.0.0:80/
Quit the server with CONTROL-C.
[10/Nov/2012 07:07:13] "GET / HTTP/1.1" 200 6463
[10/Nov/2012 07:07:15] "GET /login/google-oauth2/ HTTP/1.1" 302 0
[10/Nov/2012 07:07:16] "GET /complete/google-oauth2/?state=kHfxP6**************************&code=4/U6iG************************.QsbDe1************************* HTTP/1.1" 302 0
[10/Nov/2012 07:07:16] "GET /login/error/ HTTP/1.1" 500 32
^C[root@localhost example]#
omab commented 12 years ago

What happens if you try this on a django shell in that project:

>>> from social_auth.backends.google import GoogleOAuth2
>>> print GoogleOAuth2.enabled()
some1thatNeedsHelp commented 12 years ago
[root@localhost example]# python manage.py shell
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from social_auth.backends.google import GoogleOAuth2
>>> print GoogleOAuth2.enabled()
L**********************5
>>>

_Matches "Client secret" value in Google's "API Access"._

some1thatNeedsHelp commented 12 years ago

Ops.... _wrong button!_

veonua commented 12 years ago

have the same issue even with example application VkontakteOAuth2 provider as well

Facebook and Google OpenID works

you need to log more info, because current sting gives no clue what have been happened

omab commented 12 years ago

@some1thatNeedsHelp, I've pushed some refactoring to the exception handling mechanism, that might help to debug your issue, which I don't see a reason to happen (the backends mentioned are working quite well). The error mentioned only raises if the backend is not present on AUTHENTICATION_BACKENDS or somehow it's not enabled. Try firing up a django shell and try this other snippet:

>>> from django.conf import settings
>>> print settings.AUTHENTICATION_BACKENDS
some1thatNeedsHelp commented 12 years ago

Traceback

Environment:

Request Method: GET
Request URL: http://86.19.105.115.xip.io/sa/complete/google-oauth2/?state=mRNrtmsGHN9H0rECoK2ba9brCc2OkUKX&code=4/1afpPTi50nVpKqrhENldUYD5hufZ.koiKd37lg70ZOl05ti8ZT3aTxEYJdgI

Django Version: 1.4.2
Python Version: 2.6.6
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'social_auth',
 'app')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/views/decorators/csrf.py" in wrapped_view
  77.         return view_func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/django_social_auth-0.7.7-py2.6.egg/social_auth/decorators.py" in wrapper
  39.                 return func(request, backend, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django_social_auth-0.7.7-py2.6.egg/social_auth/views.py" in complete
  39.         return complete_process(request, backend, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django_social_auth-0.7.7-py2.6.egg/social_auth/views.py" in complete_process
  97.     user = auth_complete(request, backend, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django_social_auth-0.7.7-py2.6.egg/social_auth/views.py" in auth_complete
  170.     return backend.auth_complete(user=user, request=request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django_social_auth-0.7.7-py2.6.egg/social_auth/backends/__init__.py" in auth_complete
  766.             return authenticate(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py" in authenticate
  43.     for backend in get_backends():
File "/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py" in get_backends
  34.         backends.append(load_backend(backend_path))
File "/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py" in load_backend
  16.         raise ImproperlyConfigured('Error importing authentication backend %s: "%s"' % (path, e))

Exception Type: ImproperlyConfigured at /sa/complete/google-oauth2/
Exception Value: Error importing authentication backend social_auth.backends.contrib.dailymotion.DailymotionBackend: "No module named dailymotion"

Commands

[root@localhost ~]# rm -rf django-social-auth/
[root@localhost ~]# history | grep git | tail
  792  history | grep git
  793  git clone git://github.com/omab/django-social-auth.git
  797  git log | head
 1005  history | grep git
 1006  git clone git://github.com/omab/django-social-auth.git
 1008  git log | head
 1014  history | grep git
 1015  git clone git://github.com/omab/django-social-auth.git
 1017  git log | head
 1033  history | grep git | tail
[root@localhost ~]# git clone git://github.com/omab/django-social-auth.git
Initialized empty Git repository in /root/django-social-auth/.git/
remote: Counting objects: 6367, done.
remote: Compressing objects: 100% (2153/2153), done.
Receiving objects: 100% (6367/6367), 895.94 KiB | 249 KiB/s, done.
remote: Total 6367 (delta 4795), reused 5715 (delta 4193)
Resolving deltas: 100% (4795/4795), done.
[root@localhost ~]# cd django-social-auth/
[root@localhost django-social-auth]# git log | head
commit 0f69f99c029ecdbaead163cb6724677679497050
Author: Matías Aguirre <matiasaguirre@gmail.com>
Date:   Thu Nov 15 13:01:18 2012 -0200

    Remove html valid badges

commit e06f4822277538bfe73767613f2fe165a14d7814
Author: Matías Aguirre <matiasaguirre@gmail.com>
Date:   Wed Nov 14 23:03:58 2012 -0200

[root@localhost django-social-auth]# cd example/example/
[root@localhost example]# mv local_settings.py.template local_settings.py
[root@localhost example]# vi local_settings.py
[root@localhost example]# cd ..
[root@localhost example]# python manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table social_auth_usersocialauth
Creating table social_auth_nonce
Creating table social_auth_association
Creating table app_customuser

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'):
E-mail address: root@test123.work
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
[root@localhost example]# python manage.py runserver 0.0.0.0:80
Validating models...

0 errors found
Django version 1.4.2, using settings 'example.settings'
Development server is running at http://0.0.0.0:80/
Quit the server with CONTROL-C.
[12/Nov/2012 06:49:33] "GET / HTTP/1.1" 500 247129
^C[root@localhost example]# !sed
sed -i "s/'social_auth.backends.stripe.StripeBackend',/#'social_auth.backends.stripe.StripeBackend',/" example/settings.py | grep -i strip
[root@localhost example]# python manage.py runserver 0.0.0.0:80
Validating models...

0 errors found
Django version 1.4.2, using settings 'example.settings'
Development server is running at http://0.0.0.0:80/
Quit the server with CONTROL-C.
[12/Nov/2012 06:51:02] "GET / HTTP/1.1" 500 247824
[12/Nov/2012 06:51:03] "GET / HTTP/1.1" 200 5675
[12/Nov/2012 06:51:05] "GET /sa/login/google-oauth2/ HTTP/1.1" 302 0
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.twitter.TwitterBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.facebook.FacebookBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.google.GoogleOAuthBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.google.GoogleBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.yahoo.YahooBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.linkedin.LinkedinBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.skyrock.SkyrockBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.flickr.FlickrBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.instagram.InstagramBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.github.GithubBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yandex.YandexBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yahoo.YahooOAuthBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.foursquare.FoursquareBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.OpenIDBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.live.LiveBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.douban.DoubanBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.browserid.BrowserIDBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.vkontakte.VKontakteBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yandex.YandexOAuth2Backend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yandex.YaruBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.odnoklassniki.OdnoklassnikiBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.odnoklassniki.OdnoklassnikiAppBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.vkontakte.VKontakteOAuth2Backend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.mailru.MailruBackend'>.
  DeprecationWarning)
[12/Nov/2012 06:51:06] "GET /sa/complete/google-oauth2/?state=IoInHdJydysvJdBs7W9UbCtWjCLogQzt&code=4/1NmdsFs-TTnSEGLdGnE1uCliyt4j.4mwa6BgtEjMeOl05ti8ZT3ZdT0cJdgI HTTP/1.1" 500 144367
^C[root@localhost example]#
some1thatNeedsHelp commented 12 years ago

Okay! I finally got it working!

_Commands_

[root@localhost example]# sed -i "s/'social_auth.backends.contrib.dailymotion.DailymotionBackend',/#'social_auth.backends.contrib.dailymotion.DailymotionBackend',/" example/settings.py
[root@localhost example]# python manage.py runserver 0.0.0.0:80
Validating models...

0 errors found
Django version 1.4.2, using settings 'example.settings'
Development server is running at http://0.0.0.0:80/
Quit the server with CONTROL-C.
[12/Nov/2012 06:55:51] "GET /sa/complete/google-oauth2/?state=m******************************X&code=4/1************************Z.k**************************I HTTP/1.1" 500 98982
^C[root@localhost example]sed -i "s/'social_auth.backends.contrib.shopify.ShopifyBackend',/#'social_auth.backends.contrib.shopify.ShopifyBackend',/" example/settings.py
[root@localhost example]# python manage.py runserver 0.0.0.0:80
Validating models...

0 errors found
Django version 1.4.2, using settings 'example.settings'
Development server is running at http://0.0.0.0:80/
Quit the server with CONTROL-C.
[12/Nov/2012 06:56:27] "GET /sa/complete/google-oauth2/?state=m******************************X&code=4/1************************Z.k**************************I HTTP/1.1" 500 98945
^C[root@localhost example]sed -i "s/'social_auth.backends.contrib.stocktwits.StocktwitsBackend',/#'social_auth.backends.contrib.stocktwits.StocktwitsBackend',/" example/settings.py
[root@localhost example]# ^C
[root@localhost example]# python manage.py runserver 0.0.0.0:80
Validating models...

0 errors found
Django version 1.4.2, using settings 'example.settings'
Development server is running at http://0.0.0.0:80/
Quit the server with CONTROL-C.
[12/Nov/2012 06:57:02] "GET /sa/complete/google-oauth2/?state=m******************************X&code=4/1************************Z.k**************************I HTTP/1.1" 500 123231
[12/Nov/2012 06:57:06] "GET / HTTP/1.1" 200 5675
[12/Nov/2012 06:57:09] "GET /sa/login/google-oauth2/ HTTP/1.1" 302 0
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.twitter.TwitterBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.facebook.FacebookBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.google.GoogleOAuthBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.google.GoogleBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.yahoo.YahooBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.linkedin.LinkedinBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.skyrock.SkyrockBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.flickr.FlickrBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.instagram.InstagramBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.github.GithubBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yandex.YandexBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yahoo.YahooOAuthBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.foursquare.FoursquareBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.OpenIDBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.live.LiveBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.douban.DoubanBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.browserid.BrowserIDBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.vkontakte.VKontakteBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yandex.YandexOAuth2Backend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.yandex.YaruBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.odnoklassniki.OdnoklassnikiBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.odnoklassniki.OdnoklassnikiAppBackend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.vkontakte.VKontakteOAuth2Backend'>.
  DeprecationWarning)
/usr/lib/python2.6/site-packages/Django-1.4.2-py2.6.egg/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'social_auth.backends.contrib.mailru.MailruBackend'>.
  DeprecationWarning)
[12/Nov/2012 06:57:10] "GET /sa/complete/google-oauth2/?state=6******************************4&code=4/***************************l.0*****************************I HTTP/1.1" 302 0
[12/Nov/2012 06:57:10] "GET /form/ HTTP/1.1" 200 2652
[12/Nov/2012 06:57:13] "POST /form/ HTTP/1.1" 302 0
[12/Nov/2012 06:57:13] "GET /sa/complete/google-oauth2/ HTTP/1.1" 302 0
[12/Nov/2012 06:57:13] "GET / HTTP/1.1" 302 0
[12/Nov/2012 06:57:13] "GET /done HTTP/1.1" 301 0
[12/Nov/2012 06:57:13] "GET /done/ HTTP/1.1" 200 5921
^C[root@localhost example]#

As you can see from the sed commands, I had to disable dailymotion, shopify, stocktwits just the same as stripe. Else it would say

Exception Value: No module named stripe

Afterwards, it would work! =) *p.s. I had to re login to Google, to alter the URL:

Redirect URIs:  http://<domain>/sa/complete/google-oauth2/

Last time

Redirect URIs:  http://<domain>/complete/google-oauth2/

Note: that '/sa/' is added

Anyway... Its now working for me & OAuth2

some1thatNeedsHelp commented 12 years ago

@omab Thanks for sorting out the issue. I take my hat off to you at the speed you work. Please, keep up the good work

omab commented 12 years ago

@some1thatNeedsHelp, I've removed /sa/ in the last commit, it had some big impact in the defined apps. Glad that it worked, my guess is that global installed packages are interfering with your example testing. Can we close this?

Edit: ignore my close question, you already did that.

some1thatNeedsHelp commented 12 years ago

@omab Ill update again then (;

And yeah, I guess the egg files were playing a part in this. Which is funny cos I don't remember doing anything related to it (I don't have PIP installed!)

Yup, problem fixed, thread closed (: Thanks once again!