Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase 3.x - Token / Session Expiration

Does anyone know how long would it take for the token to expire? There no option now to set the token validity on the console.

like image 720
shibapoo Avatar asked May 27 '16 15:05

shibapoo


People also ask

How long firebase Token expired?

Firebase ID tokens are short lived and last for an hour; the refresh token can be used to retrieve new ID tokens. Refresh tokens expire only when one of the following occurs: The user is deleted.

How do I refresh my firebase token?

You can refresh a Firebase ID token by issuing an HTTP POST request to the securetoken.googleapis.com endpoint. The refresh token's grant type, always "refresh_token". A Firebase Auth refresh token. The number of seconds in which the ID token expires.

How do I decode a firebase token?

The Firebase Admin SDK has a built-in method for verifying and decoding ID tokens. If the provided ID token has the correct format, is not expired, and is properly signed, the method returns the decoded ID token. You can grab the uid of the user or device from the decoded token.


1 Answers

In the latest release of Firebase Authentication, login sessions don't expire anymore. Instead it uses a combination of long-lived account tokens and short-lived, auto-refreshed access tokens to get the best of both worlds.

If you want to end a user's session, you can call signOut().

like image 99
Frank van Puffelen Avatar answered Sep 28 '22 03:09

Frank van Puffelen