gpt4 book ai didi

html - Google Identity Toolkit - 登录后出现 Google 登录错误 400

转载 作者:行者123 更新时间:2023-11-28 04:51:48 25 4
gpt4 key购买 nike

我目前正在开发一个管理系统来编辑网站内容,并且需要一个登录系统来让我检查用户是否在某个 Google 群组中,所以我正在使用 Google 登录平台(作为Google Identity Toolkit),但是,当我点击“登录”并选择帐户时,小部件只显示“错误 400:这就是我们所知道的”。

我已根据 Google Sign In 上的文档从头开始多次重写登录系统。网站不折不扣。我的代码如下:
头:

<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="User-ID.apps.googleusercontent.com">

正文:

<div class="g-signin2" data-onsucess="onSignIn"></div>
<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());
}
</script>

我的 Google Developers 项目设置为接受来自本地主机和 127.0.0.1 的 Javascript 来源(即使它们是同一事物),并且没有重定向 URI,因为不需要它们。

我查看了 Google Status 网站,一切似乎都很好,并向我的 ICT 老师寻求帮助,所以我完全被困住了,任何帮助将不胜感激!

提前致谢:)

最佳答案

更新:在我的浏览器中从 127.0.0.1 切换到 localhost 似乎已经解决了这个问题,很奇怪,但只要它有效!

关于html - Google Identity Toolkit - 登录后出现 Google 登录错误 400,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30957961/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com