使用刷新令牌 PHP 的 eBay OAuth 令牌

发布于 2025-01-13 01:28:38 字数 651 浏览 6 评论 0原文

请帮助我使用刷新令牌 API 修复 eBay OAuth 令牌中的无效范围问题。我处于生产模式。即使主要范围 https://api.ebay.com/oauth/api_scope 也无法正常工作为我。我正在使用 PHP。

$curlSecondHandler = curl_init();

curl_setopt_array($curlSecondHandler, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => "grant_type=refresh_token&refresh_token=".$refreshToken."&scope=".urlencode($scopes),
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode($clientId . ':' . $certId)
],
]);

Please help me to fix the invalid scope issue in eBay OAuth Token Using Refresh Token API. I am in production Mode. Even not the primary scope https://api.ebay.com/oauth/api_scope is working for me. I am using PHP.

$curlSecondHandler = curl_init();

curl_setopt_array($curlSecondHandler, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => "grant_type=refresh_token&refresh_token=".$refreshToken."&scope=".urlencode($scopes),
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode($clientId . ':' . $certId)
],
]);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弱骨蛰伏 2025-01-20 01:28:38

确保范围与同意请求期间使用的范围相同。您还可以删除scopes参数以获取原始同意请求中的所有范围。如果您希望添加更多范围,则需要再次获得附加范围的同意并获得新的刷新令牌。
https://developer.ebay.com/api-文档/static/oauth-refresh-token-request.html

Make sure that the scopes are the same as the ones used during the consent request. You can also remove the scopes parameter to get all the scopes from the original consent request. If you wish to add more scopes, you would need to go through consent once again with the additional scopes and gain a new refresh_token.
https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文