Advertisement
michaelyuen

Untitled

Jan 18th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Google-Signin</title>
  6. <meta name="google-signin-client_id" content="__client_id_____.apps.googleusercontent.com">
  7. <script
  8.   src="https://code.jquery.com/jquery-3.2.1.min.js"
  9.   integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
  10.   crossorigin="anonymous"></script>
  11. <script src="https://apis.google.com/js/platform.js" async defer></script>
  12. </style>
  13. </head>
  14. <body>
  15.  
  16. <div class="g-signin2" data-onsuccess="onSignIn"></div>
  17.  
  18. <script type="text/javascript">
  19. function onSignIn(googleUser) {
  20. var profile = googleUser.getBasicProfile();
  21. console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
  22. console.log('Name: ' + profile.getName());
  23. console.log('Image URL: ' + profile.getImageUrl());
  24. console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
  25.  
  26. var email = profile.getEmail();
  27. alert(email);
  28.  
  29. }
  30. </script>
  31.  
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement