Skip to content

Commit

Permalink
Make BackendWrapper respect backends interface. Refs #53
Browse files Browse the repository at this point in the history
  • Loading branch information
omab committed Oct 10, 2013
1 parent c7152d6 commit ebaa4b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions social/apps/django_app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

4 comments on commit ebaa4b5

@jedmondson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I upgraded my social-auth install to v0.1.17 last night via PIP (install --upgrade) but this BackendWrapper class wasn't in utils.py.
I manually added it and everything functions fine.
Not sure what happened, but the exclusion of this class may have been the result of installing with the upgrade switch?

@omab
Copy link
Owner Author

@omab omab commented on ebaa4b5 Dec 1, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedmondson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks. I appreciate all your work on this.

@omab
Copy link
Owner Author

@omab omab commented on ebaa4b5 Dec 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem!

Please sign in to comment.