基本的 Google 网站登录代码在 Internet Explorer 11 中不起作用 [英] Basic Google Sign-In for Websites code not working in Internet Explorer 11

查看:27
本文介绍了基本的 Google 网站登录代码在 Internet Explorer 11 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Google 登录网站 (https://developer.google.com/identity/sign-in/web/) 并注意到我的解决方案在 Internet Explorer 11 中不起作用.为了尝试消除尽可能多的因素,我创建了一个基于Google 提供的示例代码.

I am attempting to use Google Sign-In for Websites (https://developers.google.com/identity/sign-in/web/) and noticed that my solution is not working in Internet Explorer 11. To try to eliminate as many factors as possible, I created a simple test case based on the sample code provided by Google.

我已经在 Windows 7 PC 上的 Chrome、Mac 上的 Chrome、Mac 上的 Safari、Mac 上的 Firefox 和 iPhone 上的 Safari 中测试了它.它适用于所有这些(例如,当我单击登录按钮并选择/输入我的 Google 帐户时,它返回到页面并且按钮显示已登录").

I've tested it in Chrome on my Windows 7 PC, Chrome on my Mac, Safari on my Mac, Firefox on my Mac and Safari on my iPhone. It works on all of these (e.g., when I click the sign in button and select/enter my Google account, it returns to the page and the button says, "Signed in").

但是,它不适用于 PC 上的 Internet Explorer 11,或者奇怪的是,它不适用于 iOS 版 Chrome.单击该按钮后,会打开一个窗口,让我可以选择我的 Google 帐户,但在进行选择后,该窗口会关闭并返回页面,该按钮仍显示登录".

It does not, however, work on Internet Explorer 11 on PC or, strangely enough, Chrome for iOS. When the button is clicked, a window opens to allow me to select my Google account, but after making a selection, the window closes and returns to the page with a button that still says, "Sign In."

这是示例代码:

<html>
<head>
<meta name="google-signin-client_id" content="61023618497-vqfbod57f26ncjl9d6firk3t09ve4tt3.apps.googleusercontent.com">
<script src="https://apis.google.com/js/platform.js" async defer></script>
</head>
<body>
<div class="g-signin2"></div>
</body>
</html>

对可能发生的事情有任何想法吗?我已经四处搜索,但没有找到任何解决方案.

Any ideas as to what might be going on? I've searched around and have not found any solutions.

一个想法是将accounts.google.com"添加到 IE 的可信站点.这没有用.我还尝试通过 https 而不是 http 访问页面.那也没什么区别.还有什么我应该尝试的吗?

One idea was to add "accounts.google.com" to IE's Trusted Sites. This didn't work. I also tried accessing the page via https instead of http. That didn't make a difference either. Anything else I should try?

推荐答案

我现在遇到了同样的问题,几个月后.

I ran into the same problem now, a few months later.

如果你看:

https://developers.google.com/identity/sign-在/web/build-button

并尝试使用他们的演示按钮登录,它不适用于 IE11(但它适用于我在不同操作系统上使用的其他浏览器).我找不到任何解决方案.

and try a signin with their demo button, it does not work with IE11 (but it works with other browsers I am using at different OS). I could not find any solution.

我将评论留给未来的读者,他们将在未来搜索同样的问题.如果 Google 的演示按钮不起作用,她至少可以放心,问题可能不在她的代码中.:)

I am leaving the comment for a future reader, who searches for the same problem in the future. If the demo button at Google does not work, she can at least rest assured that the problem is probably not in her code. :)

这篇关于基本的 Google 网站登录代码在 Internet Explorer 11 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆