简体   繁体   中英

php zend gdata - Get list of google docs using 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();

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.

Thank you everyone!

    // 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\n";
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM