|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59663 Error on Google contact API
Submitted: 2011-03-10 12:14 UTC Modified: 2021-10-18 15:33 UTC
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:2 (66.7%)
From: djpate at gmail dot com Assigned: cmb (profile)
Status: Closed Package: oauth (PECL)
PHP Version: 5.3.5 OS: Ubuntu 10.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: djpate at gmail dot com
New email:
PHP Version: OS:


 [2011-03-10 12:14 UTC] djpate at gmail dot com

I had a contact inviter script that was working on 1.0 that doesnt work anymore with 1.1.

It seems to be a problem with the request token method.

Thanks in advance.

Reproduce code:
$this->oauth = new \OAuth($this->consumer_key,$this->shared_secret);
$request_token_info = $this->oauth->getRequestToken("");

Expected result:
A request token

Actual result:
'OAuthException' with message 'Invalid auth/bad request (got a 411, expected HTTP/1.1 20X or a redirect)'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-10 14:09 UTC]
Can you try trunk?

- JJ
 [2011-03-13 07:43 UTC] djpate at gmail dot com
The request token works from trunk but It fails when I try to fetch info

Length Required
POST requests require a Content-length header
 [2011-03-13 14:35 UTC]
Are you using the cURL or streams engine?
 [2011-03-14 03:47 UTC] iceberg_young at yahoo dot com dot cn
I also got this error. Post blocked by my proxy.
 [2011-03-14 03:52 UTC] iceberg_young at yahoo dot com dot cn
More details:

Downloaded from

source version
$Id: oauth.c 308061 2011-02-06 17:15:34Z jawed $

$bahamut = new OAuth(BAHAMUT_ID, BAHAMUT_SECRET);
$token = $bahamut->getRequestToken(BAHAMUT_OAUTH_REQUEST_TOKEN_URL, BACK_URL);
 [2011-03-14 08:35 UTC] patrick at procurios dot nl
Hate to say "Me too", but this bug is blocking for the application that is to go live by the end of this week. :}
 [2011-03-14 08:50 UTC] djpate at gmail dot com
I'm not sure of what you mean by 

Are you using the cURL or streams engine?
 [2011-03-14 15:47 UTC]
The extension has two request engines, one powered by cURL and the 
other by PHP streams.


I'm not sure why the Content-Length request header would disappear from 
POST requests off hand from 1.0.

- JJ
 [2011-03-14 18:54 UTC]
Okay, there are two problems in this ticket:
1) the request token fetching fails (seems to be fixed in 
2) other requests are not working

Please give more details surrounding #2 or otherwise explain 
what "It fails when I try to fetch info" means.
 [2011-03-17 07:03 UTC]

I'm not sure why Google requires a Content-Length header, it 
seems like in newer versions of mod_security the restriction 
is "gone".

That being said, can you guys try to do a GET request on the 
endpoint? Also the endpoint would be helpful so we can debug 

- JJ
 [2011-03-17 08:25 UTC] djpate at gmail dot com
Thanks for the headsup

The endpoint is

And I can confirm that it works with a GET request
 [2011-03-17 08:51 UTC]
No problem, I'm trying to figure out how to force a Content-
Length header w/POST requests in libcurl at the moment.

- JJ
 [2011-05-25 21:01 UTC] tpurdy at gmail dot com
I just encountered this same issue trying to connect to Google 
Contacts. Is there any workaround?
 [2011-05-26 09:01 UTC]
tpurdy: Workaround is to use streams or 
authorization header :)
 [2021-10-18 15:33 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-10-18 15:33 UTC]
> Workaround is to use streams […]

Since the curl http wrapper is removed as of PHP 5.5.0, this issue
should be resolved.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 14:01:25 2023 UTC