Skip to content

Instantly share code, notes, and snippets.

@dkwasniak
Created October 15, 2014 18:42
Show Gist options
  • Save dkwasniak/3ae50f1e22dce966a7a9 to your computer and use it in GitHub Desktop.
Save dkwasniak/3ae50f1e22dce966a7a9 to your computer and use it in GitHub Desktop.
authentication
@psa('social:complete')
def register_by_access_token(request, backend):
# This view expects an access_token GET parameter, if it's needed,
# request.backend and request.strategy will be loaded with the current
# backend and strategy.
token = request.GET.get('access_token')
user = backend.do_auth(request.GET.get('access_token'))
if user:
login(request, user)
return 'OK'
else:
return 'ERROR'
@elmkarami
Copy link

@avonil instead of backend.do_auth try request.backend.do_auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment