Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save user to db without 'request' in register_by_access_token(request, backend) function? #393

Closed
Matusko opened this issue Sep 19, 2014 · 1 comment

Comments

@Matusko
Copy link

Matusko commented Sep 19, 2014

I would really like to use psa as authentication system (im using django) for my single page app. I have a function exchanging authorisation_code given by client for access_token like this:

def auth(request):
code = request.POST['code']
provider = 'google-oauth2'
...
return access_token, client_id, expires_in, token_type

If i want to create and persist my user using this example http://python-social-auth.readthedocs.org/en/latest/use_cases.html#signup-by-oauth-access-token
I dont really know what the request should be.

Is there some way how to create a db record from this using psa?

@jaitaiwan
Copy link
Contributor

@Matusko not sure what you're exactly asking here...

I don't think I understand you correctly, but isn't this user = backend.do_auth(request.GET.get('access_token')) the part of the example that you need?

It seems like you've already got the request as part of your function definition.

@omab omab closed this as completed Apr 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants