In https://console.developers.google.com/apis/credentials/oauthclient I created a "Client ID for Web application", No restrictions: empty "Authorized JavaScript origins" and empty "Authorized redirect URIs". I receiv a client Id and put it on a page.
Below is the most basic page sample. I receive the message:
400. That’s an error.
Error: invalid_request
Permission denied to generate login hint for target domain.
??? what's wrong?
<head>
<meta name="google-signin-client_id" content="****26190863-tm7mr9racl8bgooifq2kjssb1n7teoob.apps.googleusercontent.com">
</head>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<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());
}
</script>
<body>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
</body>