简体   繁体   English

如何缩短Firebase身份验证令牌的到期时间以进行测试

[英]How to shorten the expiration time on Firebase auth tokens for testing

I am trying to test my refresh token logic using Firebase auth but waiting an hour for it to expire is maddening. 我正在尝试使用Firebase身份验证测试刷新令牌逻辑,但等待一个小时使其过期令人发狂。 The documentation doesn't seem to mention anything about customizing the time: https://firebase.google.com/docs/auth/admin/create-custom-tokens 该文档似乎没有提及有关自定义时间的任何内容: https : //firebase.google.com/docs/auth/admin/create-custom-tokens

I am signing in with: 我使用以下身份登录:

firebase
      .doSignInWithEmailAndPassword(email, password)

Ideally I would like it to expire in five minutes or less. 理想情况下,我希望它在五分钟或更短时间内过期。 Anyone know how to do this? 有人知道怎么做吗?

FWIW: I found this discussion ( https://groups.google.com/forum/#!msg/firebase-talk/NWKw28SvBi8/fi4s2l1rAgAJ ) which makes it sound like it wasn't possible over a year ago, just hoping this has changed or someone has found a workaround since then. FWIW:我发现了这个讨论( https://groups.google.com/forum/#!msg/firebase-talk/NWKw28SvBi8/fi4s2l1rAgAJ ),这听起来像一年前不可能,只是希望这已经从那以后更改或有人找到了解决方法。

There is no way to change the expiration time for ID/access tokens minted by Firebase Authentication itself. 无法更改Firebase身份验证本身生成的ID /访问令牌的到期时间。 The only thing I can think of is minting your own tokens, and setting the exp property to suit your needs. 我唯一能想到的就是铸造自己的令牌,并设置exp属性以满足您的需求。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM