我目前正在尝试开发一个小型应用来验证我自己的用户。
首先我导航到
https://auth.ebay.com/oauth2/authorize?
client_id=...&
response_type=code&
redirect_uri=...&
scope=...
哪个要求我登录,然后通过URL给我授权码。
我对此进行了url解码,并使用邮递员打以下命令来请求访问令牌:
https://api.ebay.com/identity/v1/oauth2/token
带有标题:
Authorization: Basic ...
Content-Type: application/x-www-form-urlencoded
这两个似乎都是正确的,因为如果我更改它们中的任何一个,我都会收到一个错误消息,指出它们是错误的。
并在体内:
grant_type: authorization_code
redirect_uri: ...
code: ...
再次将所有这些错误单独更改为其他内容。
我得到的错误是:
{
"error": "invalid_grant",
"error_description": "the provided authorization grant code is invalid or was issued to another client"
}
这对我来说很奇怪。这使用与先前请求相同的redirect_uri和client_id。
[我尝试生成一个新的重定向URL,尝试旋转客户端机密,不尝试对auth代码进行url解码,但是无论尝试如何,都会遇到相同的错误。
有趣的是,如果我请求一个client_credentials的grant_type可以正常工作,但对我却没什么用。
我很困惑,ebay论坛毫无帮助,任何帮助将不胜感激。
我目前正在尝试开发一个小型应用来验证我自己的用户。首先,我导航到https://auth.ebay.com/oauth2/authorize? client_id = ...&response_type = code&redirect_uri = ...&...
我实际上已经设法自己解决了。