我像这样通过邮递员的有效负载发送我的访问令牌,以获取电子邮件、我后端的姓名等信息:
{
"access_token": "my-google-acces-token"
}
在后端,我尝试将此访问令牌发送到google请求,如下所示:
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"
}
}
我做错了什么?我的谷歌访问令牌是正确的
目前没有回答
相关问题 更多 >
编程相关推荐