google-admin-sdk - 谷歌工作区 API 的访问被拒绝
问题描述
我试图访问谷歌工作区 api。api 文档链接 - https://developers.google.com/admin-sdk/reports/reference/rest 访问 api,需要发送 header 的访问令牌。所以我执行以下步骤,第 1 步 - 创建 oauth 2.0 gcp 中的凭据。然后获取 clientId 和 clientSecret。第 2 步 - 我将谷歌工作区域范围委派添加到 clientId 和范围。第 3 步 - 我正在使用 OAuth 2.0 Playground ( https://developers.google.com/oauthplayground ) 提供 clientid 和 clientsecret。选择https://www.googleapis.com/auth/admin.reports.audit.readonly、https://www.googleapis.com/auth/admin.reports.usage.readonly的范围。我正在获取访问令牌。在我尝试了api之后。
API - https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/login 错误 - { "error": { "message": "访问被拒绝。您无权阅读活动记录。”,“代码”:401,“错误”:[ {“原因”:“authError”,“locationType”:“标题”,“消息”:“访问被拒绝。您无权读取活动记录。” ,“域”:“全球”,“位置”:“授权”}]}}
解决方案
推荐阅读
- javascript - 如何将 html、css 和 javascript 应用程序迁移到 react-native 组件中?
- javascript - WordPress 中的 Ajax 后过滤器故障排除 - 不响应 WP_Query
- twilio - Twilio WebChat 客户端 - Create-React-App - 捆绑和散列
- amazon-web-services - AWS GlueJob 错误 - 命令失败,退出代码为 137
- java - 在 Javamail 中未显示附件
- asp.net-core - 使用 IHostedService 运行 1 个任务
- flutter - Flutter Unhandled Exception: setState() 在构造函数中调用:
- python - 无法通过回传传递 django 模板变量数组以查看
- java - 如何在 Android Studio 的 Android 应用程序中添加 APN 策略?
- python - Pytest ModuleNotFoundError