Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Google Hybrid Protocol (OpenID+OAuth) #35

Open
GoogleCodeExporter opened this issue Mar 21, 2015 · 3 comments
Open

Support for Google Hybrid Protocol (OpenID+OAuth) #35

GoogleCodeExporter opened this issue Mar 21, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Hello,

It seems that this class doesn't support Google Hybrid Protocol with is 
basically an OAuth extension to the OpenID protocol: 
http://code.google.com/apis/accounts/docs/OpenID.html#oauth

Here is what I did to support it

* I added a public $oauth variable (false)
* Added this code to authUrl_v2:

if ( $this->oauth ) {
    $params['openid.ns.oauth'] = 'http://specs.openid.net/extensions/oauth/1.0';
    $params['openid.oauth.consumer'] = str_replace(array('http://','https://'),'',$this->trustRoot);
    $params['openid.oauth.scope'] = implode(' ',$this->oauth);
}

It's a bit hackish, but it's working for my needs. Usage example (to get the 
OAuth working you have to register your domain in Google first):

$openid->identity = "https://www.google.com/accounts/o8/id";
// request access to Google Analytics
$openid->oauth = array(
    'https://www.google.com/analytics/feeds/'
);

Hope this help!

Regards

Original issue reported on code.google.com by remi.lan...@gmail.com on 12 Apr 2011 at 11:16

@GoogleCodeExporter
Copy link
Author

Hi, thanks for this code, I have been looking for a way to do just this with 
this library.

Just one question, what is the code to get Oauth Request Token and then trade 
it for the Access token?
Does it come in the $openid->getAttributes() variable?

Thanks

Original comment by marc...@santiago.cl on 1 Aug 2011 at 2:43

@GoogleCodeExporter
Copy link
Author

Support for Google hybrid protocol has been added in the Github clone of 
LightOpenID at: https://github.com/iignatov/LightOpenID.

A new method was added for getting the OAuth request token - 
getOAuthRequestToken().

Hope this helps.

Original comment by ignat.ig...@gmail.com on 2 Dec 2012 at 7:33

@GoogleCodeExporter
Copy link
Author

Is there an example anywhere of using LightOpenID with the hybrid OpenID and 
OAuth?  It doesn't look like the iignatov code actual supports the hybrid 
functionality.

Original comment by jeff.kis...@gmail.com on 3 Dec 2013 at 10:06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant