social-app-django
social-app-django copied to clipboard
Unauthorized for url: https://www.googleapis.com/oauth2/v3/userinfo
Working in a mobile app that send the Google Token to the server. On the sever I try to verify the token with no sucess. I use the following view. I have already tried many sets of credentials including the ones setup for the Android app.
SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE = ['email', 'profile']
@api_view(http_method_names=['POST'])
@permission_classes([AllowAny])
@psa()
def exchange_token(request, backend):
access_token = request.data.get('token')
user = request.backend.do_auth(access_token)
return {'meta': 'ok'}
I get the following error:
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://www.googleapis.com/oauth2/v3/userinfo
Can anyone help? Thanks
We had the same problem and the solution was a correct review about the token, because you cant use manager account tokens if you are run in localhost, and the same in the otherway. Good luck