gpt4 book ai didi

node.js - 谷歌 OAuth 2 "accessNotConfigured"错误

转载 作者:搜寻专家 更新时间:2023-11-01 00:08:24 25 4
gpt4 key购买 nike

昨晚,一个已经正常运行了大约六个月的网站在使用 Google OAuth 时开始出现 403 错误。验证码没有改变,我也没有看到谷歌 OAuth 突然改变的任何注释。我已尝试重新发布客户端 ID(包括客户端密码),但这并没有解决问题。

详细信息:

  • 完整错误:“访问未配置。请使用 Google Developers Console 为您的项目激活 API。”在这个(已清理的)请求之后出现:

    https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=https%3A%2F%2Fx.y.com%2Fauth%2Fgoogle%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&client_id=12345-abcdefg.apps.googleusercontent.com

    响应 header 确实包含这个(已清理):

    Location:   https://x.y.com/auth/google/callback?code=4/MF-V...

    其中包含的代码与我在 API Playground 中看到的类似。

  • 服务器设置:使用 passport/passport-google-oauth 运行 express 的 node.js。

我不知道需要启用什么 API -- 我觉得这是一个误读错误。 Developers Console 的“APIs & auth”部分中的 API 似乎都不相关。我在“APIs & auth > Credentials”下配置 OAuth。这不是 youtube 或 Google+ 身份验证。

最佳答案

我认为这不是导致问题的原因,但无论如何您都应该意识到这一点。 Using OAuth 2.0 for Login (early version)

Important: Google has deprecated the early implementation of OAuth 2.0 for login that is described in this document and will no longer support it, after a migration period. If your app uses OAuth 2.0 login (early version), you should either switch to Google+ Sign-In or update your existing userinfo endpoints and scopes by the deadline given in the migration timetable. For instructions, see Migrate or update OAuth 2.0 login.

迁移时间表显示在 2014 年 9 月 1 日它已经消失:https://developers.google.com/+/api/auth-migration#timetable

关于node.js - 谷歌 OAuth 2 "accessNotConfigured"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22642269/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com