Using the quick start sample provided by Google I've been able to get Sign In for Web Apps to work in Chrome and Firefox. However it fails on Internet Explorer (version 11.) It will log the user into Google but the data-onsuccess
call back is never called. And there are typically no notifications of any errors.
I've read a related question and have tried the suggestions around Trusted Sites. I've also experimented with adjusting when IE accepts 3rd party cookies but none of this seems to work.
The code for the test page I'm using is below (minus the client-id)
<html>
<head>
<meta charset="ISO-8859-1">
<title>Google Sign In</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="CLIENT_ID_FROM_GOOGLE_HERE">
<script>
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId());
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail());
}
function signOut() {
console.log(document);
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
console.log('User signed out.');
});
}
</script>
</head>
<body>
<h1>Login</h1>
<p>
This is a simple page to test Google Sign In IE
</p>
<div class="g-signin2" data-onsuccess="onSignIn">
Sign In Button Rendered Here
</div>
<div>
<a href="#" onclick="signOut();">Sign out</a>
</div>
</body>
</html>
I've also tried this with code that uses listeners to listen for changes, as suggested by some answers. I've had no success with that approach either. Again works in Chrome/Firefox but not in IE.
Every so often (not all the time) I do see a "SCRIPT5: Access is denied" error message in the Console. Not exactly sure why but I do notice that when the page is ultimately loaded some of the Google Code is in an <iframe>
and I'm wondering if this is part of the problem.
I host the above test page on a local instance of Apache (running in Windows) and I'm wondering if there are cross domain issues perhaps with the code in the <iframe>
coming from Google.
I'm at a complete loss at the minute and I'm eager to know if anyone has managed to get this to work with IE. Is there some configuration required to IE to allow this to work? Are there changes to the code needed to make it work? Or is it just essentially unworkable in IE?
An alternate that I can try is the server side flow however I'm not sure if this avoids the problem and ideally I'd like to use client side approach.
Any feedback is appreciated. Thank you.
Edit: I've hosted a simple page that illustrates the problem. This page works in Chrome, Firefox, and Safari. But fails when IE (v11) is used.