我像这样通过邮递员中的有效载荷发送我的 access_token,以在我的后端获取电子邮件、姓名等信息。:
{
"access_token": "my-google-acces-token"
}
在后端,我尝试将此 access_token 发送到这样的谷歌请求:
response = requests.get('https://www.googleapis.com/oauth2/v2/userinfo',
headers={'Authorization': f'Bearer {access_token_data}'})
我得到了这个回复:
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
我做错了什么?我的 google-access-token 是对的