Custom Token Refresh

138 views
Skip to first unread message

Adam Dahan

unread,
Feb 27, 2023, 10:36:55 AM2/27/23
to Firebase Google Group
Hi I am using the Google Admin SDK node library for creating custom tokens like so: 

getAuth
()
 
.createCustomToken(uid)
 
.then((customToken) => {
   
// Send token back to client
 
})
 
.catch((error) => {
    console
.log('Error creating custom token:', error);
 
});

However, my app often becomes "unauthorized" after 1 hour period of time. How can I perform a token refresh from the client? 

Thanks

Arthur Thompson

unread,
Feb 27, 2023, 6:09:20 PM2/27/23
to fireba...@googlegroups.com
The Firebase Auth token expiring after 1 hour is expected. However the Firebase Client SDKs automatically refresh the token for you. Are you using the Firebase Client SDK?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/8a655aac-a2c6-4d89-adea-03d3714fe796n%40googlegroups.com.

Mhd Fahem Rejab

unread,
Feb 27, 2023, 7:25:32 PM2/27/23
to fireba...@googlegroups.com
Do you have access role as an IAm admin on cloud? If so u just create a new credentials 

--

Adam Dahan

unread,
Feb 27, 2023, 10:09:49 PM2/27/23
to fireba...@googlegroups.com
I am using the Firebase Client SDK and I've found a method for refreshing the token now thank you :) 


You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/eSzbEvTypLo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CANXaM1rzHqWFOXQLkfv7EJNvn9GgnS66mZwq1H2ctA1Qpn-gkQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages