title: Login with Google using PHP API library
body: <p>I've  downloaded the  Google API PHP and I'm trying it out with a "log in with Google" script.every think i working fine. but i want password field as well,to save my database for further login as normal user for my web portal.
  i have use following code:</p>
  
  <pre><code>$service = new Google_Service_Oauth2($client);
  
  if ($client-&gt;getAccessToken()) 
      {
            //For logged in user, get details from google using access token
            $user         = $service-&gt;userinfo-&gt;get();
            $user_id      = $user['id'];}
  //list all user details
      echo '&lt;pre&gt;';
      print_r($user);
      echo '&lt;/pre&gt;';
  </code></pre>
  
  <p>and output of the $user is:</p>
  
  <pre><code>Google_Service_Oauth2_Userinfoplus Object
  (
      [internal_gapi_mappings:protected] =&gt; Array
          (
              [familyName] =&gt; family_name
              [givenName] =&gt; given_name
              [verifiedEmail] =&gt; verified_email
          )
  
      [email] =&gt; example@gmail.com
      [familyName] =&gt; man
      [gender] =&gt; male
      [givenName] =&gt; deadman
      [hd] =&gt; 
      [id] =&gt; 123456789012345
      [link] =&gt; https://plus.google.com/101978174620808672845
      [locale] =&gt; en-GB
      [name] =&gt; dead man
      [picture] =&gt; https://******************/photo.jpg
      [verifiedEmail] =&gt; 1
      [modelData:protected] =&gt; Array
          (
              [verified_email] =&gt; 1
              [given_name] =&gt; dead
              [family_name] =&gt; man
          )
  
      [processed:protected] =&gt; Array
          (
          )
  
  )
  </code></pre>
  
  <p>how to get password field from google?</p>