Firebase Android Authentication failed: expired_token (Auth token is expired)

kandroid picture kandroid · May 29, 2016 · Viewed 13.6k times · Source

I encounter an issue with Android Firebase Auth using com.google.gms:google-services:3.0.0 and com.google.firebase:firebase-auth:9.0.1.

1 hour after authentication with Firebase (Google or Facebook), I get the following error:

W/PersistentConnection: pc_0 - Authentication failed: expired_token (Auth token is expired)

Why does Firebase token expire after 1 hour and how to extend this expiration period?

UPDATE

I still encounter this issue, Firebase token expires after 1 hour. Now I get the following message: W/PersistentConnection: pc_0 - Authentication failed: invalid_token (Invalid claim 'kid' in auth header.)

I appreciate any help.

Answer

Karthi R picture Karthi R · Jul 13, 2016

If we use default Auth providers like (Google, Facebook, Email..), updating "SHA-1 key" of your Application in firebase console would fix the token expiry issue.

In this discussion a Google developer shared a guide to solve this problem.

Guide: https://drive.google.com/file/d/0B94LePkXiqa6SXVFd3N1NzJHX1E/view