0

I am using the Google Admin SDK on my node server to create custom token's that a client can use for authentication like so:

const uid = 'some-uid';

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

These tokens expire after an hour...

What is a good way for the client to refresh this token so they can continue using the app without a hiccup? Looking for any suggestions!

I tried looking for some documentation around Refresh tokens or something a like and I've found nothing so far. The only thing I can think of is getting my app to call this endpoint every time it becomes active. But I am looking for a better way to solve this issue.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    lot of info here https://stackoverflow.com/questions/38233687/how-to-use-the-firebase-refreshtoken-to-reauthenticate – Shubhank Feb 27 '23 at 14:46
  • Beauty - thank you. Going to try to implement and see if it solves the problem. Will mark as answered shortly if it works. – Adam Dahan Feb 27 '23 at 18:20

0 Answers0