Skip to content

Instantly share code, notes, and snippets.

@rodolfofadino
Created June 28, 2020 20:50
Show Gist options
  • Save rodolfofadino/9bda206da40f63b102a1ae0000ae9f50 to your computer and use it in GitHub Desktop.
Save rodolfofadino/9bda206da40f63b102a1ae0000ae9f50 to your computer and use it in GitHub Desktop.
Google one tap
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="g_id_onload"
data-client_id="390285071447-nulpiuehvrjqg91cnah18sj52mlt9c2b.apps.googleusercontent.com"
data-callback="handleCredentialResponse">
</div>
<script src="https://accounts.google.com/gsi/client" async defer></script>
<script src="https://cdn.jsdelivr.net/npm/jwt-decode@2.2.0/build/jwt-decode.min.js"></script>
<script>
function handleCredentialResponse(response) {
var decodedToken = jwt_decode(response.credential);
console.log(decodedToken.name);
console.log(decodedToken.email);
}
</script>
</body>
</html>
@dieptang
Copy link

How you verify the token ID from server side ?

@ali123-dhaku
Copy link

Thanks Brother

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment