var doWaitResponseGoogle = false; function signinCallback (authResult) { if (doWaitResponseGoogle) { if (authResult['status']['signed_in']) { doWaitResponseGoogle = false; /* gapi.client.load('oauth2', 'v2', function() { gapi.client.oauth2.userinfo.get().execute(function(resp) { console.log("================================================"); for (var data in resp) { console.log (data + " : " + resp[data]); } console.log("================================================"); doOtherStuff (resp, "googleplus"); }); }); */ gapi.client.load('plus', 'v1', apiClientLoaded); } else { // Posible error values: // "user_signed_out" - User is signed-out // "access_denied" - User denied access to your app // "immediate_failed" - Could not automatically log in the user } } } function apiClientLoaded () { gapi.client.plus.people.get({userId: 'me'}).execute(handleResponse); } function handleResponse (resp) { var obj = {}; console.log("================================================"); obj.id = resp.id; obj.name = resp.displayName; obj.given_name = resp.name.givenName; obj.family_name = resp.name.familyName; for (var i=0; i Getting Google+ data, Please Wait ...'); var additionalParams = { 'clientid': '366877405866-8h2f5er9ejtbgbs8e9gk1sar9q8u00mc.apps.googleusercontent.com', 'cookiepolicy': 'single_host_origin', /* 'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read https://www.googleapis.com/auth/userinfo.email',*/ 'scope': 'profile email', 'callback': 'signinCallback' }; doWaitResponseGoogle = true; gapi.auth.signIn(additionalParams); }