且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google API 令牌端点 POST 返回错误请求 400

更新时间:2022-06-19 07:04:06

答案如下:API 需要 2 次调用.第一次调用返回一个一次性授权码.第一个调用必须指定重定向 URI.

So here's the answer: The API requires 2 calls. The first call returns a one time authorization code. The first call must specify a redirect URI.

第二次调用将一次性代码发送到 API 以获得授权令牌.此 POST 还需要重定向 URI.

The 2nd call sends the one time code to the API for an authorization token. This POST also requires a redirect URI.

第一次调用中的重定向 URI 必须与第二次调用中的重定向 URI 相同!!!

我无法在文档中的任何地方找到它.请记住,此 URI 还必须与您的开发者控制台中列表中的 URI 之一匹配,所有文档都这么说.

I was unable to find this anywhere in the documentation. Remember that this URI must also match one of the URIs in the list in your developers console, which is what all the documentation says.