THis is regarding to retrive my google contact using gdata library of zend framework. I am able to retrieve my all google contact with username and password. But i want something different like retrieve it with secret ky and seceret id for that i have regestered my application with outh2.0 in google console api and retrieve secrate key and seceret id. using this seceret id i am able to retrieve token as well but i dont know how to retrive my google contact using this token can any on help..
https://github.com/jcleblanc/oauth/tree/master/oauth2-php-google
This link was provided in a previous question and has a complete example of fetching the Contacts feed with PHP and OAuth 2.0.
If you're trying to access the contacts of accounts in a Google Apps domain you administer, you can use two-legged authentication (2LO) and OAuth 1.0 in Zend. Then you generate a consumer key and consumer secret key, and create the http client like this:
$oAuthOptions = array(
'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER,
'version' => '1.0',
'signatureMethod' => 'HMAC-SHA1',
'consumerKey' => [YOUR CONSUMER KEY],
'consumerSecret' => [YOUR CONSUMER SECRET],
'xoauth_requestor_id' => [EMAIL OF ACCOUNT TO ACCESS]
);
$consumer = new Zend_Oauth_Consumer($oAuthOptions);
$token = new Zend_Oauth_Token_Access();
$client = $token->getHttpClient($oAuthOptions,null);
More on two/three legged authentication on OAuth 1.0: https://code.google.com/p/google-mail-xoauth-tools/wiki/PhpSampleCode