"Google auth"
Bootstrap 3.0.0 Snippet by victorgaldamezstarshot

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!-- ttps://developers.google.com/identity/sign-in/web/ --> <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"> </head> <body> <div class="container"> <div class="row"> <div class="g-signin2" data-onsuccess="onSignIn" data-theme="dark"></div> </div> </div> <script src="https://apis.google.com/js/platform.js" async defer></script> <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>

Related: See More


Questions / Comments: