firebase auth/invalid-custom-token

Can you go to https://jwt.io and decode your custom token. It should look like this:

{
  "uid": "some-uid",
  "iat": 1500147255,
  "exp": 1500150855,
  "aud": "https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.IdentityToolkit",
  "iss": "firebaseserviceaccount@YOUR_PROJECT_ID.iam.gserviceaccount.com",
  "sub": "firebaseserviceaccount@YOUR_PROJECT_ID.iam.gserviceaccount.com"
}

YOUR_PROJECT_ID should match the same project on your client side project.


The token is expired. The Firebase SDK throws the same error: auth/invalid-custom-token error for both malformatted tokens and expired tokens.

Hopefully, the error handling improves soon, in the meantime developer can check to see if a token is expired by using a client side library like jwt decode and checking the "exp" timestamp and comparing to the current time.