简体   繁体   English

firebase是否对每个admin.auth()。verifyIdToken(idToken)发出网络请求?

[英]Does firebase make a network request for every admin.auth().verifyIdToken(idToken)?

I have a firebase client(browser). 我有一个Firebase客户端(浏览器)。 I also have a backend server that I identify the user is signed in using the firebase token. 我还有一个后端服务器,可以识别用户是否使用Firebase令牌登录。

With following Firebase's docs Verify ID tokens using the Firebase Admin SDK , I am successfully using admin.auth().verifyIdToken(idToken) to verify the token on my node server. 遵循以下Firebase的文档(使用Firebase Admin SDK验证ID令牌) ,我成功使用admin.auth().verifyIdToken(idToken)来验证节点服务器上的令牌。

However, one thing concerns me. 但是,有一件事与我有关。 I know that firebase uses a cert to verify the tokens. 我知道firebase使用证书来验证令牌。 Does this mean that everytime I invoke admin.auth().verifyIdToken(idToken) a outgoing network request/network transaction is made from my node server? 这是否意味着每次我调用admin.auth().verifyIdToken(idToken)都会从节点服务器进行传出网络请求/网络事务? I am concerned because I would consider this expensive if so. 我很担心,因为如果这样我会认为这很昂贵。

I tried to use tcpdump but traffic is to much and to cryptic to tell. 我尝试使用tcpdump,但是流量很大,而且难以理解。

I had a quick look at the Node.js implementation of verifyIdToken on Github . 我快速浏览了Github上的verifyIdTokenNode.js实现

As far as I can see the only roundtrip it does is to fetch the public keys for the certs, which it only does if they're expired. 据我所知,它唯一的往返就是获取证书的公钥 ,只有在证书过期时才这样做。 Most of the other work are parameter checks and of course the actual verification of the token . 其他大多数工作是参数检查,当然还有令牌实际验证

So from what I can tell there should not be a 1:1 relation between the number of incoming verification requests and the number of outgoing network requests. 因此,据我所知,传入验证请求的数量与传出网络请求的数量之间不应存在1:1的关系。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 admin.auth().verifyIdToken(idToken) 错误:在 8.0.0 之后无法使用 firebase-admin 加载默认凭据 - admin.auth().verifyIdToken(idToken) Error: Could not load the default credentials whith firebase-admin after to 8.0.0 Firebase - TypeError: admin.auth(...).createUserWithEmailAndPassword 不是函数 - Firebase - TypeError: admin.auth(…).createUserWithEmailAndPassword is not a function Firebase功能错误<admin.auth is not a function at ..> - Firebase function error <admin.auth is not a function at ..> 管理员firebase错误:“ admin.auth(...)。generatePasswordResetLink不是函数” - Error with admin firebase: “admin.auth(…).generatePasswordResetLink is not a function” Firebase admin.auth()。getUser(uid)挂起(NodeJS) - Firebase admin.auth().getUser(uid) hangs (NodeJS) [ERR_INVALID_ARG_TYPE]:第一个参数必须是字符串类型或缓冲区的实例。 使用 admin.auth().verifyIdToken 时 - [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer. when using admin.auth().verifyIdToken admin.auth(...)。createSessionCookie不是函数 - admin.auth(…).createSessionCookie is not a function Firebase管理员:admin.auth()。delete(uid)在AVA test.after()中无法解析 - Firebase Admin: admin.auth().delete(uid) not resolving in AVA test.after() Firebase 后台管理员用于 verifyIdToken 并使用 Firestore - Firebase admin on backend for verifyIdToken and use Firestore 如何修复 Firebase admin verifyIdToken 不是 function - How to fix Firebase admin verifyIdToken is not a function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM