google oauth令牌的链接是什么?

Chr*_*sen 10 oauth

我尝试与谷歌一起使用OAuth.我收到一个使用POST的代码

https://accounts.google.com/o/oauth2/v2/auth
Run Code Online (Sandbox Code Playgroud)

然后我尝试通过POST获取访问令牌

https://www.googleapis.com/oauth2/v4/token 
Run Code Online (Sandbox Code Playgroud)

但这会给我一个"未找到"的错误.这个URI错了吗?感谢你的支持...

BMi*_*tch 6

我现在为 Oauth2 令牌工作的 URI 是

https://www.googleapis.com/oauth2/v3/token

我在文档中看到了相同的“ v4 ”,但也无法正常工作。


如果您正在Google 基础架构上开发自己的OAuth 2.0客户端,我建议您使用 Google 的OAuth 2.0 Playground,它会引导您完成对其 API 的每个请求和响应。

  • 目前它是 v4,但我想它会随着时间的推移而改变 (4认同)

jwi*_*eke 2

Google 已弃用 Oauth。对于 OAuth 2.0,请尝试其著名的 OpenID 配置链接,其中显示:

"authorization_endpoint": "https://accounts.google.com/o/oauth2/v2/auth"
Run Code Online (Sandbox Code Playgroud)

  • Get方法返回404,使用Post (2认同)
  • 重要的是位于以下位置:https://accounts.google.com/.well-known/openid-configuration 这是 Google 为 OIDC 信息提供的位置:“authorization_endpoint”:“https://accounts.google。 com/o/oauth2/v2/auth”正如@danipenaperez所说。 (2认同)