Skip to content

Commit

Permalink
Docs regarding Django 1.6 and backends enforced into AUTHENTICATION_B…
Browse files Browse the repository at this point in the history
…ACKENDS. Refs #53
  • Loading branch information
omab committed Oct 10, 2013
1 parent 7055c20 commit c7152d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/configuration/django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,30 @@ Exception processing is disabled if any of this settings is defined with a
DEBUG = True


Django 1.6
----------

Since this change `django@dc43fbc`_ Django enforces authentication backends to
be defined on ``AUTHENTICATION_BACKENDS`` setting, but ``python-social-auth``
uses a wrapper (BackendWrapper_) in order to get access to the strategy which
is unknown to backends and application-dependent.

The wrapper is not defined in ``AUTHENTICATION_BACKENDS`` and that breaks the
authentication flow, until a better solution is implementing (reducing the
coupling between the classes and easing access to strategies) this wrapper
**must** be added to ``AUTHENTICATION_BACKENDS`` setting like this::

AUTHENTICATION_BACKENDS = (
# Social backends
...
'social.apps.django_app.utils.BackendWrapper',
...
)

.. _MongoEngine: http://mongoengine.org
.. _MongoEngine Django integration: http://mongoengine-odm.readthedocs.org/en/latest/django.html
.. _django-social-auth: https://github.com/omab/django-social-auth
.. _Django built-in app: https://github.com/omab/python-social-auth/tree/master/social/apps/django_app
.. _AUTHENTICATION_BACKENDS: http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#authentication-backends
.. _django@dc43fbc: https://github.com/django/django/commit/dc43fbc2f21c12e34e309d0e8a121020391aa03a
.. _BackendWrapper: https://github.com/omab/python-social-auth/blob/master/social/apps/django_app/utils.py#L44
1 change: 1 addition & 0 deletions examples/django_example/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
'social.backends.amazon.AmazonOAuth2',
'social.backends.email.EmailAuth',
'social.backends.username.UsernameAuth',
'social.apps.django_app.utils.BackendWrapper',
'django.contrib.auth.backends.ModelBackend',
)

Expand Down

0 comments on commit c7152d6

Please sign in to comment.