Answers for "google sign in"

1

html login with google

<html lang="en">
  <head>
    <meta name="google-signin-scope" content="profile email">
    <meta name="google-signin-client_id" content="YOUR_CLIENT_ID.apps.googleusercontent.com">
    <script src="https://apis.google.com/js/platform.js" async defer></script>
  </head>
  <body>
    <div class="g-signin2" data-onsuccess="onSignIn" data-theme="dark"></div>
    <script>
      function onSignIn(googleUser) {
        // Useful data for your client-side scripts:
        var profile = googleUser.getBasicProfile();
        console.log("ID: " + profile.getId()); // Don't send this directly to your server!
        console.log('Full Name: ' + profile.getName());
        console.log('Given Name: ' + profile.getGivenName());
        console.log('Family Name: ' + profile.getFamilyName());
        console.log("Image URL: " + profile.getImageUrl());
        console.log("Email: " + profile.getEmail());

        // The ID token you need to pass to your backend:
        var id_token = googleUser.getAuthResponse().id_token;
        console.log("ID Token: " + id_token);
      }
    </script>
  </body>
</html>
Posted by: Guest on October-09-2020
4

sign in with google

1. Open the Google API Console Credentials page.
https://console.developers.google.com/apis/credentials

2. Click Select a project, then NEW PROJECT, and enter a name for the project, 
and optionally, edit the provided project ID. Click Create.

3. On the Credentials page, select Create credentials, then OAuth client ID.

4. You may be prompted to set a product name on the Consent screen; if so, 
click Configure consent screen, supply the requested information, and click 
Save to return to the Credentials screen.

5. Select Desktop app for the Application type, and enter any additional 
information required.

Click Create.

6. On the page that appears, copy the client ID and client secret to your 
clipboard, as you will need them when you configure your client library.

reference:
https://developers.google.com/adwords/api/docs/guides/authentication#installed
Posted by: Guest on April-24-2021
0

google sign in pub

dependencies:
  google_sign_in: ^4.5.6
Posted by: Guest on November-29-2020

Browse Popular Code Answers by Language