RealmTeam / django-rest-framework-social-oauth2

python-social-auth and oauth2 support for django-rest-framework
MIT License
1.06k stars 191 forks source link

Missing token parameter #174

Closed ernst545 closed 6 years ago

ernst545 commented 6 years ago

I'm trying to login user via Facebook Account Kit. Front-end gives me access-token after all staff with mobile phone. I tried http://127.0.0.1:8000/auth/convert-token/ to login user with these params:

token:<Account Kit Access token>
backend:facebook
grant_type:convert_token
client_id:<client_id>
client_secret:<client_secret>

The response is:

{
    "error": "invalid_request",
    "error_description": "Backend responded with HTTP400: {\"error\":{\"message\":\"Malformed access token\",\"type\":\"OAuthException\",\"code\":190,\"fbtrace_id\":\"BZcg4h0KhBv\"}}."
}

I tried to change token into code and the response is:

{
    "error": "invalid_request",
    "error_description": "Backend responded with HTTP400: {\"error\":{\"message\":\"Malformed access token\",\"type\":\"OAuthException\",\"code\":190,\"fbtrace_id\":\"BZcg4h0KhBv\"}}."
}
PhilipGarnero commented 6 years ago

Never heard of Facebook Account Kit before. However this issue is not related with this project. As you can see, facebook answers back to you saying your token is malformed. The default facebook backend provided by python-social-auth is probably not working with your kind of tokens. Look over there in order to see if they have a backend or issues for your problem.