本文介紹了php zend gdata - 使用 oauth 獲取谷歌文檔列表的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我用我這樣設置的有效令牌進行了會話:
I've got my session with the valid token that i set up this way :
$session_token = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);
// Store the session token in our session.
$_SESSION['cal_token'] = $session_token;
然后我希望能夠做到這一點:
Then i want to be able to do this:
$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
$docs = new Zend_Gdata_Docs($client);
$feed = $docs->getDocumentListFeed();
但是使用令牌.而不是使用 user/pass/service 進行身份驗證
But using the token. Instead of the authentication with user/pass/service
我已經看過一些這樣的例子,但我沒有找到任何讓它工作的方法.
I already looked at some example of this but i didn't find any way to make it work.
謝謝大家!
推薦答案
// Retrieve user's list of Google Docs
$client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['cal_token']);
$docs = new Zend_Gdata_Docs($client);
$feed = $docs->getDocumentListFeed();
foreach ($feed->entries as $entry) {
echo "$entry->title
";
}
這篇關于php zend gdata - 使用 oauth 獲取谷歌文檔列表的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!