I'm using this php wrapper, successfully getting a code from pinterest using the link generated according to the docs:
$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:
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.
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.
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.
Make sure the Dreamhost server is using an HTTPS URL e.g. is using TLS. That could be the reason why you get a 403.
Related
As I run script on localhost works fine. but on server showing 403 error:
in my google console
for redirect url - xyz.com/change/googlelogin
in my browser - after login with google auth it show me like -
xyz.com/change/googlelogin?code=4/sgAnQ7T_O5l7bDPgaMQ4_s-c0Abz_wxsVPIt5bPQdaklIdF0QyoQicTXyW7CUQHh5ScUBZ4GYyyV8cZyiX-mu3s&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/userinfo.email with above error
This is because of modesecurity restrictions from your hosting provider. Request them to disable for your domain. I was facing same issue ,i contacted support center and they fixed issue. Now it is working fine.
Reference Link
So I have been following the tutorial to set up a LinkedIn login for my website.
I am able to do first two steps with ease and I get the authorization code.
Now I have to send HTTP POST and get JSON response to complete my LinkedIn API. I used following method to do same but I am getting an error.
Warning: file_get_contents(http://www.linkedin.com): failed to open
stream: HTTP request failed! HTTP/1.0 403 Forbidden in
D:\xampp\htdocs\LinkedIn\index.php on line 22 bool(false)
Can Anyone tell me what am I possibly doing wrong or alternative workaround?
2 Years back i worked on linkedin login but it didn't work for me too.
I suggest instead using OAuth login try with javascript SDK.
linkedin login SDK
http to https could also the reason for access forbidden because OAuth hits a server to server request which is basically http to https.
Hope this will help.
I am getting the following error when I try to setup notification using gsutil command:
gsutil notification watchbucket https://APPLICATION-ID.appspot.com/cron gs://bucket
Watching bucket gs://APPLICATION-ID.appspot.com/ with application URL https://APPLICATION-ID.appspot.com/cron ...
Watch bucket attempt failed:
AccessDeniedException: 403 Forbidden
You attempted to watch a bucket with an application URL of:
https://APPLICATION-ID.appspot.com/cron
which is not authorized for your project. Please ensure that you are using
Service Account authentication and that the Service Account's project is
authorized for the application URL. Notification endpoint URLs must also be
whitelisted in your Cloud Console project. To do that, the domain must also be
verified using Google Webmaster Tools. For instructions, please see:
https://cloud.google.com/storage/docs/object-change-notification#_Authorization
AccessDeniedException: 403 Forbidden
I have followed all the steps from the url below for Notification Authorization:
https://cloud.google.com/storage/docs/object-change-notification
But I am still getting the above error. What step am I missing ?
Thanks
I have fixed the issue myself. I had missed "https://" while adding the domain name.
Thanks
I’ve a simple PHP component that fetches videos from a public playlist on YouTube. I’m using Google’s official PHP SDK and authenticated with a server key (as I only need to access public data, not data in a user context).
Throughout development and into staging, this component has worked fine. However, I’ve moved the application to the client’s production server (a GoDaddy hosting account) and the component’s suddenly stopped working, instead throwing the following error:
Google_Service_Exception in REST.php line 83:
Error calling GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=PLAYLIST_ID&userIp=SERVER_IP&key=DEVELOPER_KEY: (403) There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.
I don’t understand. The server’s IP address is white-listed in the Google API Console. I know it’s the correct IP address, as I’ve sent a HTTP POST request from the server to another PHP script and captured the REMOTE_ADDR server variable.
I’ve also tried specifying the IP address in the request itself. The full code:
$client = new Google_Client;
$client->setApplicationName($appName);
$client->setDeveloperKey($developerKey);
$service = new Google_Service_YouTube($client);
$service->playlistItems->listPlaylistItems('snippet', array(
'maxResults' => 50,
'playlistId' => $collectionId,
'userIp' => $serverIp,
));
So what’s going? Why is Google deciding it’s not playing ball with the production server?
On my live server i'm getting a The redirect uri included is not valid. error message, whereas on my localhost OAuth works ok.
here's the full urls for both:
Localhost:
https://coinbase.com/oauth/authorize?response_type=code&client_id=xxx&redirect_uri=http%3A%2F%2Flocalhost%2Faccounts-coinbase%2Foauth&scope=balance+addresses+user+transactions
Live server (https://example.com)
https://coinbase.com/oauth/authorize?response_type=code&client_id=xxx&redirect_uri=https%3A%2F%2Fexample.com%2Faccounts-coinbase%2Foauth&scope=balance+addresses+user+transactions
I'm pretty confident I had the live server OAuth working before. Any ideas why it's failing now?
Ok I solved my own problem.
The error message, The redirect uri included is not valid. does NOT accurately reflect the issue at all. What was actually the problem is that my Coinbase OAuth app had a localhost redirect url.
The relevant OAuth redirect url, called a "callback url" is set from this rather hard to find page: https://coinbase.com/oauth/applications.
There I just switched localhost with example.com and it worked.