Page 1 of 1

Google Login

Posted: Tue Mar 19, 2013 1:05 am
by FrederickGeek8
I want to extend my login system so that I can have users login/register with their Google Account. I am looking into the documentation and I was wondering if I could get some help with it. Do you know anyways of doing this?

Also I could do it myself if I knew a way to receive everything I needed via POST or something.

EDIT: I was able to figure it myself. I modified Google's "Google Plus PHP Starter". and wrote this snippet to get all user info needed
$token = $client->getAccessToken();
  $token = json_decode($token, true);
  $token = $token['access_token'];
  $info = json_decode(file_get_contents('https://www.googleapis.com/oauth2/v1/us ... n='.$token), true);
I still have yet to implement this into the login system, but I have everything I need.