Click to below link for more details about this
https://www.getcode.in/2019/11/buildi...
Building a custom Google Sign-In button for website ,javascript api ,live or localhost
To create a Google Sign-In button with custom settings, add an element to contain the sign-in button to your sign-in page
Create project:
https://console.developers.google.com...
Create credentials
https://console.developers.google.com...
till 3 add in script code.
1 in header use google-signin-client_id
2 https://apis.google.com/js/platform.js
3 https://ajax.googleapis.com/ajax/libs...
4 use below code
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
$("#UserName").val(googleUser.getBasicProfile().getName());
$("#FirstName").val(googleUser.getBasicProfile().getName());
$("#Email").val(googleUser.getBasicProfile().getEmail());
signOut();
}
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
});
}
Download Free Code: https://idav.in/
_--Follow Me--_
Subscribe Us
Email Us: [email protected]
More Software Demos: https://codeinfosys.blogspot.com/