首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Google OAuth2有问题(应用程序没有后端,所以只限于客户端)

Google OAuth2有问题(应用程序没有后端,所以只限于客户端)
EN

Stack Overflow用户
提问于 2022-05-09 13:35:39
回答 2查看 9.5K关注 0票数 13

我试图实现客户端只使用OAuth登录。获取以下错误:

代码语言:javascript
运行
复制
details: "You have created a new client application that uses libraries for user authentication or authorization that will soon be deprecated. New clients must use the new libraries instead; existing clients must also migrate before these libraries are deprecated. See the [Migration Guide](https://developers.google.com/identity/gsi/web/guides/gis-migration) for more information."
error: "idpiframe_initialization_failed"

在此之后,每当我尝试登录时,我都会得到以下错误:

代码语言:javascript
运行
复制
error: "popup_closed_by_user"
[[Prototype]]: Object

现在我正在开发localhost:3000,因此我在http://localhost:3000 2.0客户端ID中添加了OAuth作为授权的JS来源,还尝试将发布状态从测试更改为生产。用户类型设置为外部类型。

EN

Stack Overflow用户

回答已采纳

发布于 2022-05-11 22:12:05

默认情况下,新创建的客户端ID现在被阻止使用旧平台库,现有客户端ID不受影响。2022年7月29日之前创建的新客户端ID可以设置plugin_name以启用。

因此,就我而言,解决办法是:

代码语言:javascript
运行
复制
window.gapi.load('client:auth2', () => {
            window.gapi.client.init({
                clientId: '******.apps.googleusercontent.com',
                plugin_name: "chat"
            })
票数 5
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72172877

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档