Open dllabs opened 5 years ago
I've figured out that the GooglePlus backend can work if I comment out the line in _graphql_social_auth/socialcore/backends/google.py that uses the accessToken, thereby forcing it to use the idToken instead, as follows:
def user_data(self, access_token, *args, **kwargs):
# if 'id_token' not in self.data:
# return super(GooglePlusAuth, self).user_data(access_token, *args,
# **kwargs)
response = self.get_json(
'https://www.googleapis.com/oauth2/v3/tokeninfo',
params={'id_token': access_token}
)
self.process_error(response)
return response
Better though would be to pass 'id_token' into self.data, so I don't have to comment out that line. How do I get 'id_token' into self.data in a django-graphql-social-auth mutation?
cheers
John
any updates on the above issue mentioned ?
Google's docs for Android-based OAUTH2 authentication say that we should send an idToken rather than an accessToken to our backend server.
How do you do that using Graphene Social Auth?
The only docs/examples I've found use access tokens. For instance:
I imagine I can use Graphene Social Auth as is, by exchanging my idTokens for accessTokens in my Android client, but I'd rather do that server-side as Google recommends, just by sending in the idToken to the server and then have Graphene Social Auth exchange it for an accessToken and then do its stuff.
thanks!
John