2

I'm using firebase SDK's on both ends and it works fine for all scenarios except for the below one.

requesting tokens at JS client side ( with force = true ) : https://firebase.google.com/docs/reference/js/v8/firebase.User#getidtokenresult

verifying tokens at server side : https://firebase.google.com/docs/auth/admin/verify-id-tokens#c

All my api calls works using the bearer token, validated through the above SDKs, but it fails (401) after a few minutes of inactivity from client side ( say 30mins to 60 mins ). I've tried logging the expiry timestamp from the jwt and they're valid by time

Error: Request failed with status code 401
Firebase getIdTokenResult - current ISO time : - 2022-01-10T12:03:11.364Z
Firebase getIdTokenResult - expiration time : - 2022-01-10T13:03:12Z

What could be the reason that this is failing after some time? How to debug further?

nullUser
  • 1,159
  • 2
  • 15
  • 26
  • Possible duplicate of this: https://stackoverflow.com/questions/54058211/firebase-what-should-i-do-after-idtoken-expires – JW_ Feb 01 '22 at 11:06

0 Answers0