我想访问与用户google帐户相关联的名称来解决GoogleJsonResponseException: API call to people.people.get failed with error: The caller does not have permission to request "people/me". Request requires one of the following scopes: [profile]
错误。
为了做到这一点,我试图将https://www.googleapis.com/auth/userinfo.profile范围包括在谷歌的OAuth 2.0范围列表中。但是,在编辑appsscript.json以手动包含范围(如概述的这里 )并试图保存之后,它无法工作。它显示了“拯救计划.”弹出,但如果没有我的更改,它永远不会解析和重新加载页面重置appsscript.json。作用域https://www.googleapis.com/auth/userinfo具有相同的响应。没有与此相关的错误消息。
这是我现在的档案--我是不是漏掉了什么傻事?我做错了吗?
{
"oauthScopes": "https://www.googleapis.com/auth/userinfo.names",
"timeZone": "America/New_York",
"dependencies": {
"enabledAdvancedServices": [
{
"userSymbol": "People",
"version": "v1",
"serviceId": "peopleapi"
}
]
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"webapp": {
"executeAs": "USER_DEPLOYING",
"access": "MYSELF"
}
}
发布于 2022-08-30 00:55:59
oauthScopes
应该包含一个或多个数组。考虑到这一点,改变
"oauthScopes": "https://www.googleapis.com/auth/userinfo.names",
通过
"oauthScopes": [ "https://www.googleapis.com/auth/userinfo.names" ],
https://stackoverflow.com/questions/73535604
复制相似问题