开发者

Does Zend Gdata Support OAuth?

开发者 https://www.devze.com 2023-02-11 17:43 出处:网络
I installed Zend Gdata 1.11开发者_运维技巧.2 but I don\'t see anything in it labeled OAuth... does it support OAuth?I do it like this, for Docs, Calendar, and Picasa:

I installed Zend Gdata 1.11开发者_运维技巧.2 but I don't see anything in it labeled OAuth... does it support OAuth?


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.


For OAuth there is seprate ZF component: Zend_OAuth.


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")


Oauth library is a part of the full ZF package.

0

精彩评论

暂无评论...
验证码 换一张
取 消