I set up the "login with google" button with server side authentication. Everything works in Chrome, FIrefox, Safari. In IE 11 / Edge the Google login window opens, the login is correct, but when the popup closes nothing happens. The call back function is never called. Nothing in console. I think it is the same problem of Google Sign-in in Internet Explorer / Edge In my case, just as in that other thread, the code is the same of the google examples.
<script type="text/javascript">
function signInCallback(authResult){
if (authResult['code']) {
$('#login_social').html("");
setLoading($('#login_social'),'relative');
$.ajax({
url:'gp_ajax_server_login?state=d77e966cf2e830268a4223543a853dd9',
type: 'POST',
contentType: 'application/octet-stream; charset=utf-8',
success: function(response){
if(response == "OK"){
displayLoggedUser();
}else if(response == "CL"){
window.location.href = "/snkt/";
}
},
data: authResult['code'],
processData: false
});
}else{
console.log("GOOGLE SIGN-IN ERROR");
}
}
function startAndRender(){
gapi.load('auth2', function() {
auth2 = gapi.auth2.init(
{client_id:'XXXXXXXXX.apps.googleusercontent.com'}
);
});
}
</script>
<script src="https://apis.google.com/js/client:platform.js?onload=startAndRender" async defer></script>
<center>
<button id="signinButton" class="g-signin-btn"></button>
<script>
$('#signinButton').click(function(){
auth2.grantOfflineAccess({'redirect_uri':'postmessage'}).then(signInCallback);
});
</script>
</center>