PHP Classes

Need Google 1.0a

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Need Google 1.0a  >  (Un) Subscribe thread alerts  
Subject:Need Google 1.0a
Summary:How to set up to get 1.0a auth?
Messages:5
Author:Jason Maggard
Date:2014-01-21 19:47:33
Update:2014-01-26 02:55:41
 

  1. Need Google 1.0a   Reply   Report abuse  
Picture of Jason Maggard Jason Maggard - 2014-01-21 19:47:33
I am working with an extrnal application, and they are still using the Google 1.0a oAuth protocol.

Has anyone already set this up?

I've gone through the docs and am trying, but this whole thing is making my head hurt. Is there an older version of this package that still has the oAuth 1.0a setup?

  2. Re: Need Google 1.0a   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-01-21 21:34:13 - In reply to message 1 from Jason Maggard
The class works with both OAuth 1 and 2. It is just switching a variable for the version and probably the endpoint URLs.

Anyway, what Google API still uses 1.0a but not 2.0? Here it says OAuth 1.0 was deprecated by Google.

developers.google.com/accounts/docs ...

  3. Re: Need Google 1.0a   Reply   Report abuse  
Picture of Jason Maggard Jason Maggard - 2014-01-22 14:26:49 - In reply to message 2 from Manuel Lemos
It's an app called Rise Vision that runs in the app cloud. They still haven't migrated to oAuth 2.0.

So not only do I have no clue what I'm doing, but Google keeps telling me not to. :( I also have to run this from the AppEngine, which doesn't support curl.

I was just curious if anyone had already done the endpoints for oAuth 1.0a. That's the part I'm having trouble getting. Google has their published endpoints, but connecting to them generally gets a message about the endpoint being moved.

i.e.
Published Endpoint: https://www.google.com/accounts/OAuthGetAccessToken

Connect and you get the error taht the endpoint has been moved to
accounts.google.com/o/oauth1/auth

I've gotten this far:

case 'Google':
$this->oauth_version = '1.0a';
$this->dialog_url = 'https://accounts.google.com/o/oauth1/auth?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&oauth_callback={REDIRECT_URI}&scope={SCOPE}&state={STATE}';
$this->offline_dialog_url = 'https://accounts.google.com/o/oauth1/auth?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope={SCOPE}&state={STATE}&access_type=offline&approval_prompt=force';
$this->access_token_url = 'https://www.google.com/accounts/OAuthGetAccessToken';
$this->request_token_url = 'https://accounts.google.com/o/oauth1/auth';
break;

  4. Re: Need Google 1.0a   Reply   Report abuse  
Picture of Jason Maggard Jason Maggard - 2014-01-22 16:19:16 - In reply to message 3 from Jason Maggard
This seems to work:

case 'Google':
$this->oauth_version = '1.0a';
$this->dialog_url = 'https://www.google.com/accounts/OAuthAuthorizeToken';
$this->access_token_url = 'https://www.google.com/accounts/OAuthGetAccessToken';
$this->request_token_url = 'https://www.google.com/accounts/OAuthGetRequestToken?scope={SCOPE}';
break;

This prints out the token/secret pair.

echo '<pre>Token: '.$_SESSION['OAUTH_ACCESS_TOKEN']['https://www.google.com/accounts/OAuthGetAccessToken']['value'].'</pre>';
echo '<pre>Secret: '.$_SESSION['OAUTH_ACCESS_TOKEN']['https://www.google.com/accounts/OAuthGetAccessToken']['secret'].'</pre>';


Thanks a bunch for the great package. Really a lifesaver.

  5. Re: Need Google 1.0a   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-01-26 02:55:41 - In reply to message 4 from Jason Maggard
Thanks, I have added that server to the latest class version with name Google1.