kreait / firebase-bundle

A Symfony Bundle for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
140 stars 27 forks source link

GeneratedToken expiration #3

Closed iBasit closed 8 years ago

iBasit commented 8 years ago

Hi,

I wanted to ask you a question for logic... Should I save the generated token in the db and set the expiry 99999days.. so we I can use same generated token again and again. Or this is bad consideration and I should generate new token on each new login in symfony?

Right now I have new token generated on each login, but I was thinking to save it in db and just use that rather then keep generating again and again.

jeromegamez commented 8 years ago

I think this is not in scope of this bundle, but I would recommend to not store the token in the database but rather in the respective user's session. If you want to authenticate administrative requests, you could use the firebase secret instead of the token - or regenerate the token with each request/process, this shouldn't be too expensive anyways.

jeromegamez commented 8 years ago

I closed the issue, because it's not an actual issue of this bundle, but feel free to continue the discussion - but in general, I would recommend to use the channels mentioned at https://www.firebase.com/docs/help/ for more thoughts on this or any question.