OAuth 2.0 游乐场错误 403:access_denied

OAuth 2.0 Playground Error 403: access_denied

我在尝试授权 API 时收到来自 OAuth 2.0 Playground 的授权错误。我已多次检查应用程序的权限(因为我是所有者),我已修复安全问题(google 提问),尝试了多个浏览器和多个电子邮件帐户(在新项目下)。以下是错误信息:

Error 403: access_denied
The developer hasn’t given you access to this app. It’s currently being tested and it hasn’t been verified by Google. If you think you should have access, contact the developer (recipe.tracker.app@gmail.com).
Learn more
Request Details
access_type=offline
response_type=code
redirect_uri=https://developers.google.com/oauthplayground
prompt=consent
client_id=765247627523-mhvqb7sc2or6rittk8dp0ti7b1ba8eel.apps.googleusercontent.com
scope=https://mail.google.com

我遇到了同样的问题。

我的解决方案是

  1. https://www.google.com/settings/security/lesssecureapps 启用安全性较低的应用程序
  2. https://accounts.google.com/b/0/displayunlockcaptcha启用此功能
  3. 在应用程序处于开发模式时添加电子邮件给测试用户 enter image description here

我的 OAuth 2.0 游乐场错误的解决方案:

  1. 转到您的开发者控制台。
  2. 转到 OAuth 同意屏幕。
  3. 转到+添加用户,在测试用户下。
  4. 添加测试用户(如果没有它就不能工作,甚至是所有者的电子邮件地址)