Firebase Android 身份验证失败:expired_token(身份验证令牌已过期) [英] Firebase Android Authentication failed: expired_token (Auth token is expired)
问题描述
我在使用 com.google.gms:google-services:3.0.0
和 com.google.firebase:firebase-auth:9.0.1代码>.
使用 Firebase(Google 或 Facebook)进行身份验证 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)
为什么 Firebase 令牌会在 1 小时后过期以及如何延长此有效期?
Why does Firebase token expire after 1 hour and how to extend this expiration period?
更新
我仍然遇到这个问题,Firebase 令牌会在 1 小时后过期.现在我收到以下消息:W/PersistentConnection:pc_0 - 身份验证失败:invalid_token(身份验证标头中的无效声明kid".)
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.)
感谢您的帮助.
推荐答案
如果我们使用默认的 Auth 提供程序,例如(Google、Facebook、Email..),在 firebase 控制台中更新您的应用程序的SHA-1 密钥"将修复令牌过期问题.
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.
在此讨论中,一位 Google 开发者分享了解决此问题的指南.
In this discussion a Google developer shared a guide to solve this problem.
指南:https://drive.google.com/file/d/0B94LePkXiqa6SXVFd3N1NzJHX1E查看
这篇关于Firebase Android 身份验证失败:expired_token(身份验证令牌已过期)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!