加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 验证Ruby中Google ID令牌的完整性

发布时间:2020-12-16 19:10:44 所属栏目:百科 来源:网络整理
导读:我正在将Google登录功能集成到Rails驱动的网站中.我在 https://developers.google.com/identity/sign-in/web/backend-auth跟随指南,但我遇到了一些问题. 主要的挂断是验证ID令牌段落的完整性.它概述了验证JWT的几个步骤,然后说明: Rather than writing your
我正在将Google登录功能集成到Rails驱动的网站中.我在 https://developers.google.com/identity/sign-in/web/backend-auth跟随指南,但我遇到了一些问题.

主要的挂断是验证ID令牌段落的完整性.它概述了验证JWT的几个步骤,然后说明:

Rather than writing your own code to perform these verification steps,we strongly recommend using a Google API client library for your platform,or calling our tokeninfo validation endpoint.

我一直在使用tokeninfo端点进行调试,但文档说明:

[the tokeninfo endpoint] is suitable only for deployments with fewer than 100 monthly active users,as well as for debugging and informational purposes.

Using one of the Google API Client Libraries is the recommended way to validate Google ID tokens in a production environment.

对于Java,Google API客户端库包含一个可以验证id令牌的GoogleIdTokenVerifier对象.

对于Python,提供了verify_id_token功能.

我已经搜索了Google Client API Ruby gem(目前处于alpha版)的文档以及google-auth-library-ruby gem,但未能找到相同的功能.

Ruby中有相同的这些吗?

更新:

似乎https://code.google.com/p/google-id-token/可能会这样做;但是,该项目自2014年以来尚未更新.

我正在寻找一个维护项目,最好直接从谷歌.

解决方法

存储库已移至此处: https://github.com/google/google-id-token

看起来积极维护.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读