I need to retrieve an auth token from an Android device (client side) using AccountManager.getAuthToken and then re-use it via Zend_Gdata (server side)
When using the calendar 'cl' authTokenType things work as expected,
Android source:
String calendarToken = getAuthToken(account, 'cl' ...
PHP source:
$token = // value retrieved via Android 'calendarToken'
$client = new Zend_Gdata_HttpClient;
$client->setClientLoginToken($token);
$gData = new Zend_Gdata($client);
$feed = $gData->getFeed("http://www.google.com/calendar/feeds/default/private/full");
This does work, however when using the Gmail 'mail' authTokenType things are not so smooth
Android source:
String mailToken = getAuthToken(account, 'mail' ...
PHP source:
$token = // value retrieved via Android 'mailToken'
$client = new Zend_Gdata_HttpClient;
$client->setClientLoginToken($token);
$gData = new Zend_Gdata($client);
$feed = $gData->getFeed("https://mail.google.com/mail/feed/atom/");
This keeps throwing a 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 401.
I tried to follow guidelines for the various Google Data APIs with no luck