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

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 验证Ruby中Google ID令牌的完整性前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在将Google登录功能集成到Rails驱动的网站中.我在 https://developers.google.com/identity/sign-in/web/backend-auth跟随指南,但我遇到了一些问题. @H_404_2@主要的挂断是验证ID令牌段落的完整性.它概述了验证JWT的几个步骤,然后说明:

@H_404_2@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.

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

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

@H_404_2@…

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

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

@H_404_2@对于Python,提供了verify_id_token功能.

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

@H_404_2@Ruby中有相同的这些吗?

@H_404_2@更新:

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

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

解决方法

存储库已移至此处: https://github.com/google/google-id-token @H_404_2@看起来积极维护.

猜你在找的Ruby相关文章