开发者

Getting started with Google API and oAuth

开发者 https://www.devze.com 2023-03-28 23:13 出处:网络
I\'m working on a project that requires the user to log in - but I want to use their Google Account as their Login identity.

I'm working on a project that requires the user to log in - but I want to use their Google Account as their Login identity.

I'm using this example: http://www.ioncannon.net/programming/1443/google-oauth-for-installed-apps-php-example/

To get me started, and I've managed to request an Authorize Token and use that to get an access token.

However, when I reach the very last stage of oAuth (Described as "Stage 5" in the Tutorial) I receive this error from the CURL execution:

Invalid request URIInvalid request URI

I am using the feed: https://www.google.com/m8/feeds/

What I am trying to achieve here: I simply want the user to log-in with their Google Account, and use their firstname/lastname/avatar from their Google Account on the website. Similar to using Twitter/Facebook to make contribution on a website (like commenting) without having to sign up as a m开发者_C百科ember for just that website.


Add this to the scope - https://www.googleapis.com/auth/userinfo.profile

and request information from here - https://www.googleapis.com/oauth2/v1/userinfo?alt=json

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号