I've successfully signed in with a user through Google Sign In, and it created a user account with their email and name pre-populated.
But when I send subsequent requests I get a 500 back. The problem seems to occur when social-auth tries to talk to Google. Here's the key line in the stack trace:
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://www.googleapis.com/oauth2/v3/userinfo
I'm sending Authorization=Bearer google-oauth2 <access_token> in my auth header.
I am using the access token created by the social-auth framework (one that's 25-ish characters).
However, when I replace that token with the access token returned by Google (the super long one), everything works.
Is this the correct syntax for subsequent requests?
I've successfully signed in with a user through Google Sign In, and it created a user account with their email and name pre-populated.
But when I send subsequent requests I get a 500 back. The problem seems to occur when
social-auth
tries to talk to Google. Here's the key line in the stack trace:I'm sending
Authorization=Bearer google-oauth2 <access_token>
in my auth header.I am using the access token created by the
social-auth
framework (one that's 25-ish characters).However, when I replace that token with the access token returned by Google (the super long one), everything works.
Is this the correct syntax for subsequent requests?
curl -H "Authorization: Bearer <backend_name> <backend_token>" http://localhost:8000/route/to/your/view
Edit: I figured it out. You need to remove the
<backend_name>
and just pass inBearer <backend_token>
. I guess I missed that somewhere in the docs.