最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Firebase Authentication: Where is the token stored in web? - Stack Overflow

programmeradmin1浏览0评论

I was curious about how firebase auth token works.
Then I found this answer saying that token is stored in local storage.

However, when I checked local storage in Application tab of my Google Chrome inspector, there was nothing.

So from where does the Firebase Auth SDK get the token value?

I also checked that currentUser object contains token value but I'm not sure where that came from.

I was curious about how firebase auth token works.
Then I found this answer saying that token is stored in local storage.
https://stackoverflow.com/a/62577638/7239472

However, when I checked local storage in Application tab of my Google Chrome inspector, there was nothing.

So from where does the Firebase Auth SDK get the token value?

I also checked that currentUser object contains token value but I'm not sure where that came from.

Share Improve this question edited Sep 22, 2020 at 5:07 Doug Stevenson 317k36 gold badges454 silver badges472 bronze badges asked Sep 22, 2020 at 4:40 tera_mxtera_mx 1851 silver badge13 bronze badges 2
  • 1 It is, indeed, in local storage. That's the only place where web application code can write persistently that's not a cookie. – Doug Stevenson Commented Sep 22, 2020 at 5:07
  • Thanks always for answering. I found this Google Group Comment so checked the indexedDB. Name firebaseLocalStorageDB exists and token values as well. – tera_mx Commented Sep 22, 2020 at 6:24
Add a comment  | 

2 Answers 2

Reset to default 16

Token can be found in firebaseLocalStorageDB. Please refer to this path.

Firebase saves its connection-token on a storage called "indexedDB".

You can see it by doing: inspect->application->indexedDB then you will see a firebase "key-value table" called "firebaseLocalStorage".

发布评论

评论列表(0)

  1. 暂无评论