I am using the Google Api PHP client to Log the user in. I want to get the Users Email address. I have the following code.
Scope:
$client->setScopes('https://www.googleapis.com/auth/userinfo.profile');
Code:
$request = new apiHttpRequest("https://www.googleapis.com/oauth2/v2/userinfo?alt=json");
$userinfo = $client->getIo()->authenticatedRequest($request);
$response = $userinfo->getResponseBody();
print "<pre>" . print_r(json_decode($response, true), true) . "</pre>";
This give me only the following details
Array ( [id] => 110084312800396764 [name] => Harsha M V [given_name] => Harsha M [family_name] => V [picture] => https://lh6.googleusercontent.com/-Xusc8lwgLIQ/AAAAAAAAAAI/AAAAAAAAAAA/sOthy23uJGk/photo.jpg [locale] => en )