2

I installed Zend Gdata 1.11.2 but I don't see anything in it labeled OAuth... does it support OAuth?

Charles
  • 50,943
  • 13
  • 104
  • 142
John
  • 4,820
  • 21
  • 62
  • 92

4 Answers4

2

I do it like this, for Docs, Calendar, and Picasa:

$oauthOptions = array( 
'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER, 
'version' => '1.0', 
'signatureMethod' => 'HMAC-SHA1', 
'consumerKey' => $CONSUMER_KEY, 
'consumerSecret' => $CONSUMER_SECRET 
); 

$consumer = new Zend_Oauth_Consumer($oauthOptions); 
$token = new Zend_Oauth_Token_Access(); 
$httpClient = $token->getHttpClient($oauthOptions,null);
$service = new Zend_Gdata_Photos($httpClient); //OR WHATEVER CLASS U WANT

...and then run your GData calls as normal through $service.

1

For OAuth there is seprate ZF component: Zend_OAuth.

user594791
  • 617
  • 1
  • 8
  • 15
  • 1
    Doesn't help, really. The question (as I see it) is - can we use oauth authentication in connection with zend_gdata. It'd be helpful to know how to do that - Zend documentation doesn't help much. – Tomasz Struczyński May 30 '11 at 09:36
1

No, it currently doesn't.

We integrate with a Google Documents for example, and all we can use currently is AuthSub. I haven't checked every line of code in there, but I think it's outdated in this respect. Of course we could create our own wrapper using OAuth, but this defeats the purpose of the framework for me.

Also, when you check out Google's examples, they tell you to use Zend_Oauth as well:

http://code.google.com/apis/gdata/docs/auth/oauth.html#Examples (click on "PHP")

Till
  • 22,236
  • 4
  • 59
  • 89
0

Oauth library is a part of the full ZF package.

solefald
  • 1,739
  • 1
  • 15
  • 29