Using OAuth 2.0 to access Google APIs (specifically Blogger) (PHP)

Using the Google tutorials, I am trying to access the Blogger API using the OAuth 2.0 authentication method. I have successfully authenticated using OAuth, but I don’t understand how to access the API.

All of their examples complete the $ gdclient object , which, if you use the AuthSub method, has the value Zend_Gdata_AuthSub :: getHttpClient ($ _ SESSION ['sessionToken']);

However, I cannot find what to install $ gdclient if you have authenticated with OAuth2.0! Any help please? The rest of the examples are straightforward, but, as I mentioned, they all end in $ gdclient, which I have not yet been able to install.

Blogger API Tutorials: http://code.google.com/apis/blogger/docs/1.0/developers_guide_php.html

OAuth 2.0: http://code.google.com/apis/accounts/docs/OAuth2.html

Thanks!

+4
source share
1 answer

form a headline: 3.c. ClientLogin username and password authentication

$user = ' user@example.com '; $pass = 'secretPasswd'; $service = 'blogger'; $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service, null, Zend_Gdata_ClientLogin::DEFAULT_SOURCE, null, null, Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE'); $gdClient = new Zend_Gdata($client); 
-2
source

All Articles