Skip to content

Autnticate/Create user from acces_token  #233

@ranjeetsghrix

Description

@ranjeetsghrix

I want to authenticate and create the user by access token where the access token can be sent by the Iphone/android mobile.I have googled this issue and Found some useful info but that was mostly regarding Django social auth not python social auth. I have also find out this one question mostly similar to my question #180 but his problem is related to twitter and I want to know how to register user related any back-end.
I have used this code but it gives me the error 'unicode' object has no attribute 'do_auth' , I have called this function by
url -> url(r'^auth/(?P<backend>[^/]+)/$',register_by_access_token, name="test_auth"),
and backend I am using is facebook.

@strategy() 
def register_by_access_token(request, backend, *args, **kwargs):
    access_token = {pass static token for testing purpose}
    if not access_token:
        raise AuthMissingParameter(backend, 'access_token')
    user = backend.do_auth(access_token)
    if user and user.is_active:
        login(request, user)
    return user

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions