question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refresh auth after expiration

See original GitHub issue

When i leave my app open for a long time, i start getting “auth token expired” -responses from firebase. Is there a way to use the RefreshToken for refreshing the FirebaseToken, or should i just call a SignIn.. method again before ExpresIn?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bezysoftwarecommented, Nov 23, 2016

If you manage to implement it you can do a PR and I’ll merge it into this lib 😉

1reaction
bernhardgesslercommented, Nov 19, 2016

Are you sure you’d need to refresh the third party tokens as well? From what I understand from the docs and after playing with custom tokens is that any third party token is just used once initially, to receive a firebase token. That one can then be refreshed calling:

https://securetoken.googleapis.com/v1/token?key={apiKey}

Form data: grant_type:refresh_token refresh_token:{refreshToken}

Response:

{
  "access_token": "{seems to be identical with the idToken}",
  "expires_in": "3600",
  "token_type": "Bearer",
  "refresh_token": "{refreshToken. Seems to the the same as we passed in}",
  "id_token": "{newToken}",
  "user_id": "{UID}",
  "project_id": "{projectId}"
}

So shouldn’t it be enough to check before any query/insert if the token is about to expire. And if so, do a refresh first, then go on doing the query/insert?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Refresh Token Expiration
Under Refresh Token Expiration, enable Absolute Expiration. When enabled, a refresh token will expire based on an absolute lifetime, after which the token...
Read more >
Does the refresh token expire and if so when?
ZOHO has no expiration for their refresh tokens · Auth0 rotates the refresh token for every refresh request. Regardless of implementation when ...
Read more >
Refresh Tokens - OAuth 2.0 Simplified
The expiration time of the refresh token is intentionally never communicated to the client. This is because the client has no actionable steps ......
Read more >
Refresh tokens in the Microsoft identity platform
Refresh tokens sent to a redirect URI registered as spa expire after 24 hours. Additional refresh tokens acquired using the initial refresh ......
Read more >
When to refresh an access token?
If that happens your API call will fail and you'll need to request authorization again to get new tokens. Refresh tokens expire after...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found