简体   繁体   English

Pinterest API-在Dreamhost服务器上请求访问令牌时出现403错误

[英]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.

相关问题 难以通过OAuth请求访问令牌? 错误:没有令牌或token_secret - Difficulty requesting the Access Token With OAuth? Error: No token or token_secret 使用个人访问令牌访问laravel API时发生内部服务器错误[500] - Internal Server Error[500] when using personal-access-token to access laravel api 尝试访问服务器上的“ /”时,Apache给我403错误 - Apache Gives me 403 Error when trying to access “/” on server 为 Pinterest 生成访问令牌/令牌密钥? - Generate access token / token key for Pinterest? 请求Facebook PHP Api时出错? - Error when requesting Facebook PHP Api? 在生产环境中运行 laravel horizon 在请求域/horizon 时抛出 403 错误 - running laravel horizon in production throw a 403 error when requesting domain/horizon 使用Codeigniter请求OAuth访问凭据时出现401错误 - 401 error when requesting OAuth access credentials using Codeigniter Google翻译API访问错误:(403)访问权限未配置 - Google Translate API Access Error: (403) Access Not Configured 在我的网站Twitter应用程序中请求访问令牌时显示401错误 - 401 error showing while requesting access token in my twitter application for a website Angularjs - 从自己的服务器请求 PHP 脚本返回 403 - Angularjs - requesting PHP script from own server returns 403
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM