-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
[REQUIRED] Step 1: Describe your environment
- Xcode version: 11.7
- Firebase SDK version: 6.31.0
- Firebase Component: Auth
- Component version: 6.31.0
- Installation method: Carthage
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
In our app, we use Firebase authentication token to identify user on our backend. We are sending this token with every request. We retrieve Firebase token using getIDToken(completion:) with every request.
The documentation says the method Retrieves the Firebase authentication token, possibly refreshing it if it has expired., but from time to time, we receive error Firebase ID token has expired. Get a fresh ID token from your client app and try again (auth/id-token-expired). See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token. This is kind of a major issue for our app, as we automatically log out users which receive unauthenticated error (because of user deletion functionality) - not mentioning that all of the requests automatically fail because of expired token.
Am I misunderstanding the concept of retrieving the token using getIDToken(completion:), or is this the bug in SDK?