node.js - 在运行 NGINX + Node.JS 的服务器上验证 Firebase JWT token

标签 node.js nginx firebase jwt firebase-authentication

我有一台托管 NGINX 前端和 Node.JS 后端的服务器。 场景:服务器需要将包含 JWT token 的每个请求传递到 Node.JS 后端,后者将使用 Firebase SDK 验证 token ,如果 token 通过身份验证,则应将流传递回 NGINX,NGINX 应继续执行相反的操作代理并相应路由。

到目前为止,我已经成功地将 NGINX 设置为有效运行的反向代理。我很困惑如何将 token 传递给 nginx 进行身份验证,并返回到 nginx 以在验证后继续进行反向代理。

最佳答案

我找到了解决问题的方法。 我已经在 GitHub 上创建了一个公共(public)存储库;请随意使用它或 fork 并改进。

Fire-Guard-Proxy

关于node.js - 在运行 NGINX + Node.JS 的服务器上验证 Firebase JWT token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40926304/

相关文章:

node.js - 提供数据处理进展

django - 504网关超时uwsgi + nginx Django应用程序

ssl - Ubuntu/Nginx SSL 证书不工作

android - 为什么我无法将 firebase 电子邮件密码登录链接到 google 登录?

javascript - JavaScript 中对象的 Array.prototype.map() 等价物是什么

javascript - 如何在 NodeJS 中从 MySQL 查询中生成嵌套 JSON 结果?

javascript - 在数组中将 BlueBird promise 同步链接在一起

php - 安装 nginx 后找不到 Laravel 路由

firebase - 在 Firestore sdk 片段中找不到 databaseURL

javascript - Node.js Firestore 错误 - 无法编码值