1
votes

I'm using the Admin SDK, Auth feature.

When calling admin.auth().verifyIdToken(token) and the token is expired I get the error

Firebase ID token has expired. Get a fresh token from your client app and try again. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.

With error code

auth/argument-error

First of all, should the error code not be "auth/user-token-expired"?

Second, the error code I received is not in the Admin Authentication API Errors

I have a hard time handling all firebase errors properly so I can reply with proper error messages to the consumers of my API.

1

1 Answers

0
votes

Expired tokens and invalid signatures are reported with the AuthClientErrorCode.INVALID_ARGUMENT error code. It seems the value of this constant is defined as argument-error in source. This can be fixed in a future release (or alternatively update the documentation to reflect the correct value of the constant, and avoid a potentially breaking change).

There is no such error code as auth/user-token-expired in Admin SDK. Suggest you report a feature request in the Github repo if that is important to you.