title: how to login with google account
body: <p>We want to log in with any Google account.<br>
  We created the client_id, client_secret from google developers.</p>
  
  <p>Anyone please tell me how to do.<br>
  Whatever we do that code posted below</p>
  
  <p><strong>OAuth 2.0 client IDs type is webapplication</strong></p>
  
  <p>I got this  Error: <strong>invalid_client The OAuth client was not found</strong></p>
  
  <p><a href="https://i.stack.imgur.com/lzXtX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lzXtX.png" alt="enter image description here"></a></p>
  
  <p>please any one why it is coming</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var CLIENT_ID = '349212001841-t1qnhfhp7ail46dh5rn1t6vdc10op93l.apps.googleusercontent.com';
     
      var SCOPES = [ 'https://www.googleapis.com/auth/gmail.readonly' ];
     
      function checkAuth() {
       gapi.auth.authorize({
        'client_id' : CLIENT_ID,
        'scope' : SCOPES.join(' '),
        'immediate' : true
       }, handleAuthResult);
      }
     
      function handleAuthResult(authResult) {
       var authorizeDiv = document.getElementById('authorize-div');
       if (authResult &amp;&amp; !authResult.error) {
        authorizeDiv.style.display = 'none';
        loadGmailApi();
       } else {
        authorizeDiv.style.display = 'inline';
       }
      }
     
      function handleAuthClick(event) {
       gapi.auth.authorize({
        client_id : CLIENT_ID,
        scope : SCOPES,
        immediate : false
       }, handleAuthResult);
       return false;
      }
     
      function loadGmailApi() {
       gapi.client.load('gmail', 'v1', listLabels);
      }
     
      function listLabels() {
       var request = gapi.client.gmail.users.labels.list({
        'userId' : 'me'
       });
     
       request.execute(function(resp) {
        var labels = resp.labels;
        appendPre('Labels:');
     
        if (labels &amp;&amp; labels.length &gt; 0) {
         for (i = 0; i &lt; labels.length; i++) {
          var label = labels[i];
          appendPre(label.name)
         }
        } else {
         appendPre('No Labels found.');
        }
       });
      }
     
     function appendPre(message) {
       var pre = document.getElementById('output');
       var textContent = document.createTextNode(message + '\n');
       pre.appendChild(textContent);
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
       &lt;head&gt;
        &lt;meta charset="UTF-8"&gt;
        &lt;title&gt;LoginSN&lt;/title&gt;
        &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"&gt;
        &lt;!--
         &lt;link rel="shortcut icon" href="images/favicon.png"&gt;
         &lt;link rel="apple-touch-icon" href="images/apple-touch-icon.png"&gt; 
        --&gt;
        &lt;link href="jqueryMobile/jquery.mobile-1.4.5.css" rel="stylesheet"&gt;
        &lt;link rel="stylesheet" href="css/main.css"&gt;
        &lt;script&gt;window.$ = window.jQuery = WLJQ;&lt;/script&gt;
        &lt;script src="jqueryMobile/jquery.mobile-1.4.5.js"&gt;&lt;/script&gt;
        &lt;script src="https://apis.google.com/js/client.js?onload=checkAuth"/&gt;&lt;/script&gt;
        
    &lt;/head&gt;
    
       &lt;body style="display: none;"&gt;
       
        &lt;div data-role="page" id="loginPage"&gt;
         &lt;div data-role="content" style="padding: 15px"&gt;
          &lt;h1 id="fb-welcome"&gt;&lt;/h1&gt;
       &lt;label for="text"&gt;User Name:&lt;/label&gt;&lt;input type="text" name="text" id="unL"&gt;
       &lt;label for="text"&gt;Password:&lt;/label&gt;&lt;input type="password" name="text" id="pwdL"&gt;
       &lt;a href="#dashboardPage" data-role="button" id="buttonLn"&gt;LOGIN&lt;/a&gt;
       &lt;a href="#registrationPage" data-role="button" id="buttonRe"&gt;REGISRASTION&lt;/a&gt;
       &lt;a href="#" data-role="button" id="buttonF" onclick="fblogin()"&gt;via Facebook Login&lt;/a&gt;
       &lt;!-- &lt;a href="#" data-role="button" id="login" class="g-signin2" data-onsuccess="onSignIn"&gt;via Google Login&lt;/a&gt; --&gt;
       &lt;!-- &lt;a href="#" data-role="button" id="login" onclick="callGoogle()"&gt;via Google Login&lt;/a&gt;  --&gt;
       
       &lt;!--  &lt;a href="#" data-role="button" id="login" onclick="login('google')"&gt;via Google Login&lt;/a&gt;  --&gt;
       &lt;div id="authorize-div" &gt;
         &lt;span&gt;Authorize access to Gmail API&lt;/span&gt;
         &lt;a href="#" data-role="button" id="authorize-button" onclick="handleAuthClick(event)"&gt;via Google Login&lt;/a&gt;
       &lt;/div&gt;
      &lt;/div&gt;
        &lt;/div&gt;
            &lt;div data-role="page" id="dashboardPage"&gt;
         &lt;div data-role="content" style="padding: 15px"&gt;
          &lt;a href="#" data-role="button" onclick='Logout();'&gt;LogOut&lt;/a&gt;
         &lt;/div&gt;
        &lt;/div&gt;
        
        &lt;script src="js/initOptions.js"&gt;&lt;/script&gt;
        &lt;script src="js/main.js"&gt;&lt;/script&gt;
        &lt;script src="js/messages.js"&gt;&lt;/script&gt;
        
       &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>