小编c4h*_*n3o的帖子

Google登录Web应用程序无法使用Internet Explorer

使用Google提供的快速入门示例,我已经能够登录Web应用程序以在Chrome和Firefox中使用.但是它在Internet Explorer(版本11)上失败.它会将用户登录到Google,但从data-onsuccess不会调用回调.通常没有任何错误通知.

我已阅读相关问题,并尝试了可信站点周围的建议.我还尝试调整IE何时接受第三方cookie,但这似乎都不起作用.

我正在使用的测试页面的代码如下(减去客户端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 …
Run Code Online (Sandbox Code Playgroud)

iframe internet-explorer google-openid google-oauth google-signin

23
推荐指数
1
解决办法
4088
查看次数