我正在try 使用OAuth实现客户端登录.获取以下错误:

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"

之后,每当我try 登录时,都会出现以下错误:

error: "popup_closed_by_user"
[[Prototype]]: Object

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

推荐答案

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

因此,在我的 case 中,解决方案是:

window.gapi.load('client:auth2', () => {
            window.gapi.client.init({
                clientId: '******.apps.googleusercontent.com',
                plugin_name: "chat"
            })

Javascript相关问答推荐

在分区内迭代分区

是什么原因导致此Angular 16应用程序中类型错误时属性结果不存在?

Angular中计算信号和getter的区别

Mongoose post hook在使用await保存时不返回Postman响应

如何将react—flanet map添加到remixjs应用程序

Javascript json定制

变量的值在Reaction组件中的Try-Catch语句之外丢失

如何在Angular17 APP中全局设置AXIOS

rxjs插入延迟数据

单个HTML中的多个HTML文件

是否可以在Photoshop CC中zoom 路径项?

删除元素属性或样式属性的首选方法

使每个<;li>;元素的 colored颜色 与随机生成的 colored颜色 列表不同(不重复

将范围 Select 器添加到HighChart面积图

背景动画让网站摇摇欲坠

P5.js中的分形树

MongoDB通过数字或字符串过滤列表

如何格式化API的响应

带有JS模块模式的Rails的Importmap错误:";Net::ERR_ABORTED 404(未找到)&Quot;

如何使用Angular JS双击按钮