Google 登录 HTML API 重定向且数据状态不起作用

问题描述 投票:0回答:1

我在我的应用程序中通过重定向模式使用谷歌登录(HTML API)。但根据文档,如果我们使用“数据状态”,它应该将值发布回回调中,而这没有发生,我需要该状态来从谷歌返回它以用于其他目的。

文档参考

enter image description here

HTML

<script src="https://accounts.google.com/gsi/client" async></script>

<div id="g_id_onload" data-client_id=“xxxxx.apps.googleusercontent.com" data-context="signin" data-ux_mode="redirect" data-login_uri="http://localhost:8080/googlecallback" data-auto_prompt="false"></div>

<div class="g_id_signin" data-locale="en-GB" data-type="standard" data-width="350" data-shape="rectangular" data-theme="filled_blue" data-text="signin_with" data-state=“/profile” data-size="medium">

Google 控制台 - 凭据配置

enter image description here

Google 回复帖子

client_id=xxxxx.apps.googleusercontent.com
credential=XXXXX
select_by=btn
g_csrf_token=XXXXXX

上面引用文档的谷歌响应中缺少state。如果我遗漏了什么,请帮助我?

authentication oauth-2.0 google-oauth google-signin
1个回答
0
投票

我确认这是一个问题,并且正在开发修复方案。

如果可能,共享客户端 ID 将使 Google 能够更快地验证修复是否按预期工作。

客户端 ID 是公开的,包括浏览器加载的站点 HTML 源代码,并且通常可以安全地包含在注释和代码示例中。安全性由 OAuth 授权来源和重定向 URL 维护。

© www.soinside.com 2019 - 2024. All rights reserved.