[Firebase Auth] idToken expires?

Maybe this will help you, currently it works in my app without any problem, for me it’s a direct way to work with firebase without the need of extensions, just the web component.

https://community.kodular.io/t/how-to-refresh-firebase-token-correctly/25862

I’ve created a new project to understand the firebase auth

image

This works unless I let +60 MINS without open the app

P.S: I’ve also tried this blocks
image

Id tokens expires each hour… the solution is calling a new idtoken and set a new id toker… if you need more help a can show you the block. good luck

Yes please. but am I not doing what your saying? I mean each time the user gets in the Screen 1 (opens the app) Im calling a new token. I checked it because I got into 2 or 3 times and I noticed it changed.

Im trying it right now again and here is the results of open the app twice (two diferent tokens):


If you show me how you’ve done it i would appreciate it a lot! im struggling with this

to get new idtokens use this:

If you are in the same screen for an hour and you want to reset a new idtoker you can do it with a clock to get a new idtoker automaticaly.
You will have the same id token… each hour the idtokens change

I’ve got done that here and still saying “firebase error” when i wait for +60 mins and open it again

can you show your firebase rules?

image

It only does not work when I wait for +60 Min. Even though I refresh the token, firebase seems to not work

i remember there was a bug that you get permission denied when you auth with the screen.initialize… i dont know if it is fixed… if you set the same with a botton the bug is fixed

1 Like

And with a clock do you know if it works?

Because this project was a test, but in my real app my login does not exist (because auth is via sms phone), so once the user is registered he will automatically jumps from screen 1 to his home

ones a make a proyect to reset idtokens after it expires with a clock. the easiest solution i used was set the rule “write: true” but i dont know this is a problem to your proyect. you can try with a clock to log in after some seconds later the screen initiaze and share us the results

1 Like

I used the same solution for now. Thanks. I will try (uffff waiting an hour for each solution tried…)

1 Like

Try this

And also

Now you using firebase auth I’d token in real-time database.
But your need to use web keys in real-time database.

And firebase real-time database is not secure

I know it will work if I set the rules true and place that API Key as Firebase Token, but actually is exactly that’s what I want to avoid. I do not want my DB to be .read and .write public :frowning:

It not possible. I think

I think the problem is the first token. Im trying to get 2 different id tokens with a clock. Ill tell results in 1 hour

Are you try to see data only in your admin panel app

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.