首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >错误:“idpiframe_initialization_failed”React尝试实现google登录

错误:“idpiframe_initialization_failed”React尝试实现google登录
EN

Stack Overflow用户
提问于 2022-06-08 17:26:16
回答 2查看 809关注 0票数 0

我正在尝试实现谷歌登录与反应-谷歌-登录。我使用http://localhost:3000https://localhost:3000设置凭据。并且这个错误:‘idpiframe_initialization_failed’仍然显示在控制台中。

这是错误

代码语言:javascript
运行
复制
{error: 'idpiframe_initialization_failed', details: 'You have created a new client application that use…i/web/guides/gis-migration) for more information.'}
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"
[[Prototype]]: Object
constructor: ƒ Object()
hasOwnProperty: ƒ hasOwnProperty()
isPrototypeOf: ƒ isPrototypeOf()
propertyIsEnumerable: ƒ propertyIsEnumerable()
toLocaleString: ƒ toLocaleString()
toString: ƒ toString()
valueOf: ƒ valueOf()
__defineGetter__: ƒ __defineGetter__()
__defineSetter__: ƒ __defineSetter__()
__lookupGetter__: ƒ __lookupGetter__()
__lookupSetter__: ƒ __lookupSetter__()
__proto__: (...)
get __proto__: ƒ __proto__()
set __proto__: ƒ __proto__()

这是密码

代码语言:javascript
运行
复制
<GoogleLogin 
                    clientId="CLIENT_ID.apps.googleusercontent.com"
                    render={(renderProps) => (
                        <Button className={classes.googleButton} color="primary" fullWidth onClick={renderProps.onClick} disabled={renderProps.disabled} startIcon={<Icon />} variant="contained"
                        >Google Sing in</Button>
                    )}
                    onSuccess={googleSuccess}
                    onFailure={googleFailure}
                    cookiePolicy="single_host_origin"
                />

EN

Stack Overflow用户

发布于 2022-06-08 17:42:53

为我工作:

在匿名标签里试一试,

试着重新创建你的证书,

确保你没有意外地使用https,

注意:

代码语言:javascript
运行
复制
It may take 5 minutes to a few hours for settings to take effect

试试这个:

默认情况下,新创建的客户端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"
            })
票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72549874

复制
相关文章

相似问题

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