From ebaa4b564485a1ebc2e485d7229628b6deb65911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Aguirre?= Date: Thu, 10 Oct 2013 14:16:33 -0200 Subject: [PATCH] Make BackendWrapper respect backends interface. Refs #53 --- social/apps/django_app/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/social/apps/django_app/utils.py b/social/apps/django_app/utils.py index 614091102..bedef3b88 100644 --- a/social/apps/django_app/utils.py +++ b/social/apps/django_app/utils.py @@ -42,5 +42,15 @@ def setting(name, default=None): class BackendWrapper(object): + # This backends doesn't authenticate, it's just a wrapper to return the + # user by the given ID, the user was already authenticated by a previous + # backend but since Django 1.6 will enforce backends to be defined on + # AUTHENTICATION_BACKENDS (which is not a bad idea) this wrapper needs to + # be added the setting, until a better solution is found this backends must + # be added to the setting, check: + # https://github.com/omab/python-social-auth/issues/53 + def authenticate(self, *args, **kwargs): + return None + def get_user(self, user_id): return Strategy(storage=Storage).get_user(user_id)