且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase Android身份验证失败:expired_token(身份验证令牌已过期)

更新时间:2023-01-09 13:12:49

Facebook,Email ..),在Firebase控制台更新您的应用程序的SHA-1键将修复令牌到期问题。



讨论 Google开发者分享了解决此问题的指南。



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


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.

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