首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >不允许我将编辑保存到appsscript.json

不允许我将编辑保存到appsscript.json
EN

Stack Overflow用户
提问于 2022-08-29 23:25:25
回答 1查看 56关注 0票数 0

我想访问与用户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具有相同的响应。没有与此相关的错误消息。

这是我现在的档案--我是不是漏掉了什么傻事?我做错了吗?

代码语言:javascript
运行
复制
{
  "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"
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-30 00:55:59

oauthScopes应该包含一个或多个数组。考虑到这一点,改变

代码语言:javascript
运行
复制
"oauthScopes": "https://www.googleapis.com/auth/userinfo.names",

通过

代码语言:javascript
运行
复制
"oauthScopes": [ "https://www.googleapis.com/auth/userinfo.names" ],
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73535604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档