【发布时间】:2013-12-29 14:23:06
【问题描述】:
我正在使用以下
http://www.ibm.com/developerworks/opensource/library/x-phpgooglecontact/index.html
向 Google 进行身份验证并检索用户联系人。不过,我更希望这个系统使用 Google 的 oAuth 集成。
什么是最简单的方法或一个简单的例子?
基本上我想修改这个
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, 'cp');
$gdata = new Zend_Gdata($client);
$gdata->setMajorProtocolVersion(3);
// perform query and get feed of all results
$query = new Zend_Gdata_Query(
'http://www.google.com/m8/feeds/contacts/default/full');
$query->maxResults = 1000;
$query->setParam('sortorder', 'descending');
$feed = $gdata->getFeed($query);
现在它使用 oauth2,这样用户就不必提供他们的电子邮件或密码。
【问题讨论】:
标签: php zend-framework google-contacts-api