ZF-11880: Authentication error when using Calendar library with 2-legged OAuth

Issue Type: Bug Created: 2011-11-10T10:46:01.000+0000 Last Updated: 2012-05-29T18:45:44.000+0000 Status: Closed Fix version(s): Reporter: Tim Hemming (themming) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Gdata

Related issues: Attachments:


I setup a valid HttpClient using OAuth (2-legged authentication with a consumer key and secret). This is then passed to the Zend_Gdata_Calendar constructor but when I call Zend_Gdata_Calendar#getCalendarListFeed I get the Exception:

Expected response code 200, got 401 Unknown authorization header

This is due to the required "xoauth_requestor_id" query parameter missing from the URI. There doesn't seem to be a way to set this with Zend_Gdata_Calendar.

I tried setting "xoauth_requestor_id" in the setParameterGet() method of the passed in HttpClient but Zend_Gdata_Calendar doesn't seem to use the injected instance of HttpClient to build the request and this GET parameter is ignored.

I have managed to work around this issue for now, detailed in…

It would be nice if setting "xoauth_requestor_id" was either build into the Zend_Gdata_Calendar class or if that class used HttpClient to build the request parameters.


Posted by Stephen Ostrow (isleshocky77) on 2012-03-01T20:56:08.000+0000

The reason the use of setParameterGet() doesn't work is because of the call on line 638 of Zend/Gdata/App.php which calls $this->_httpClient->resetParameters(); I am also trying to find a clean way of fixing this without modifying the core files. From digging into the code it looks like it's not possible other than extending the Zend_Gdata_Calendar class.

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-29T18:45:44.000+0000

Zend_Gdata can only be used with AuthSub/Google Data API, and does not support OAuth.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.