[英]Pinterest API - 403 error when requesting access token on Dreamhost server
I'm using this php wrapper , successfully getting a code from pinterest using the link generated according to the docs: 我正在使用此php包装器 ,使用根据文档生成的链接从pinterest成功获取代码:
$loginurl = $pinterest->auth->getLoginUrl($callback_url, array('read_public'));
Then when I run this: 然后当我运行这个:
$token = $pinterest->auth->getOAuthToken($_GET['code']);
It works fine on my local server, but when I try to run it on our Dreamhost server, I get: 它在我的本地服务器上运行良好,但是当我尝试在Dreamhost服务器上运行它时,我得到:
Pinterest error (code: 403) with message: Forbidden
I looked through the error documentation Pinterest supplies, but I can't find anything relating to 403 errors when retrieving oauth tokens. 我浏览了Pinterest提供的错误文档 ,但是在检索oauth令牌时找不到与403错误相关的任何内容。
The only two places I've seen mention of 403 errors when requesting oauth tokens from Pinterest's API have concluded that Pinterest is blocking the ips or the user agent string . 从Pinterest的API请求oauth令牌时,我看到的仅有两个地方提到403错误,这些结论都表明Pinterest阻止了ips或用户代理字符串 。
I've tried manually overriding the user agent string to no avail. 我尝试手动覆盖用户代理字符串无济于事。
I've tried contacting Pinterest to find out if there is anything I'm missing and they directed me here. 我曾尝试与Pinterest联系,以查找是否有任何我想念的东西,他们将我带到了这里。
Make sure the Dreamhost server is using an HTTPS URL eg is using TLS. 确保Dreamhost服务器正在使用HTTPS URL,例如正在使用TLS。 That could be the reason why you get a 403.
这可能就是您获得403的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.