Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Google-Signin</title>
- <meta name="google-signin-client_id" content="__client_id_____.apps.googleusercontent.com">
- <script
- src="https://code.jquery.com/jquery-3.2.1.min.js"
- integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
- crossorigin="anonymous"></script>
- <script src="https://apis.google.com/js/platform.js" async defer></script>
- </style>
- </head>
- <body>
- <div class="g-signin2" data-onsuccess="onSignIn"></div>
- <script type="text/javascript">
- function onSignIn(googleUser) {
- var profile = googleUser.getBasicProfile();
- console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
- console.log('Name: ' + profile.getName());
- console.log('Image URL: ' + profile.getImageUrl());
- console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
- var email = profile.getEmail();
- alert(email);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement