Akshay Kant
Akshay Kant

Reputation: 55

Firebase Token ID : When passed via WorkManager Android

The firebase auth token expires after typically an hour. When using Work Manager to Schedule the task to sync the local database with the global, firebase token is sent along with the request.

As Workmanager can send the request typically after the expiration of token, how can I handle this situation of token validity?

Token refresh is an option, but as I have send the request with the active token to the WorkManager and now the WorkManager sends the request after the token expiration.

I am using firebase auth token for every server request and validating it on the server. I am doing this to limit the token management on our end and use the firebase token for this.

How to handle the scenario when Work Manager sends the request after the token has expired.

Upvotes: 2

Views: 300

Answers (1)

Rajan Patel
Rajan Patel

Reputation: 1

you will need two tokens one access token and other is refresh token you can get access token from refresh token as refresh token.

Upvotes: 0

Related Questions