Last active
December 14, 2015 16:18
-
-
Save silvolu/5113766 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
(function() { | |
var po = document.createElement('script'); | |
po.type = 'text/javascript'; po.async = true; | |
po.src = 'https://apis.google.com/js/client:plusone.js'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(po, s); | |
})(); | |
function signinCallback(authResult) { | |
if (authResult['access_token']) { | |
console.log(gapi.auth.getToken()); | |
gapi.client.load('oauth2', 'v1', function() { | |
gapi.client.oauth2.userinfo.get().execute(function(resp) { | |
console.log(resp); | |
}); | |
}); | |
} else if (authResult['error']) { | |
console.log('There was an error: ' + authResult['error']); | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<span | |
class="g-signin" | |
data-callback="signinCallback" | |
data-clientid="CLIENT_ID" | |
data-cookiepolicy="single_host_origin" | |
data-requestvisibleactions="http://schemas.google.com/AddActivity" | |
data-scope="https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/devstorage.read_only"> | |
</span> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment