node.js - 找不到信封 : {"alg" :"RS256" ,"kid" :"5a66482db3800c83c63" ,"typ" :"JWT"} 的 pem

标签 node.js reactjs jwt google-oauth

我正在尝试验证和解码前端发送的 id token 。
运行验证函数时出现此错误。
有时它可能会起作用。

No pem found for envelope: {"alg":"RS256","kid":"53c666482db3800c83c63","typ":"JWT"}

这是我的代码
        const ticket = await client.verifyIdToken({
        idToken: token,
        audience: '804312674051-5o4.apps.googleusercontent.com',
    });
    const payload = ticket.getPayload();

最佳答案

我遇到了同样的问题......使用我从我的 reactJS 应用程序的 firebase 登录中获得的 idToken。

我在 google src 文件中发现

if (!certs.hasOwnProperty(envelope.kid)) {
    // If this is not present, then there's no reason to attempt verification
    throw new Error('No pem found for envelope: ' + JSON.stringify(envelope));
  }

但我不知道这意味着什么。

关于node.js - 找不到信封 : {"alg" :"RS256" ,"kid" :"5a66482db3800c83c63" ,"typ" :"JWT"} 的 pem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61203872/

相关文章:

javascript - fs-额外 : Error: EPERM: operation not permitted, 取消链接

node.js - 如何用node+express共享一个对象

css - 单击后我的复选框不会保持选中状态(带有 css 的样式复选框)

javascript - 我们可以模拟打印模式(媒体查询打印)进行单元测试吗?

asp.net - 使用 AspNet.Security.OpenIdConnect.Server (ASP.NET vNext) 实现自定义主体

node.js - 在 GAE 上进行 Sequelize 数据库迁移的最佳实践

mysql - sync-mysql node js中使用变量调用query

javascript - 将 bigint 字段中存储的日期转换为正常日期格式

Solr JWT 认证插件配置

go - 在此实现中创建 JWT 在哪里提供公钥