I think you are mixing things up.
ClientLogin and AuthSub are different authentication APIs (both deprecated).
The ClientLogin token expires after two weeks or earlier (see: https://developers.google.com/gdata/faq#clientlogin_expire). You can use the token as long as it does not expire by calling the setter setClientLoginToken
of Zend_Gdata_HttpClient
.
Example:
$client = Zend_Gdata_ClientLogin::getHttpClient('email@example.com', 'password', Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME);
$token = $client->getClientLoginToken();
//Save to DB / in session / whatever
$client = new Zend_Gdata_HttpClient();
$client->setClientLoginToken($token);
//Do stuff
You can also cache the whole HttpClient object with Zend_Cache.
AuthSub or OAuth 2.0 (better, but no classes provided by ZF) is maybe better for your needs, because the tokens do not expire (AuthSub) or can be refreshed (OAuth2)
Docs
AuthSub:
- ZF Docs > http://framework.zend.com/manual/1.12/de/zend.gdata.authsub.html
- Revoke unlimited token > https://developers.google.com/accounts/docs/AuthSub?hl=de#AuthSubRevokeToken
OAuth2: