Firebase 3.x - Token / Session Expiration

前端 未结 4 1634
春和景丽
春和景丽 2020-12-01 05:57

Does anyone know how long would it take for the token to expire? There no option now to set the token validity on the console.

4条回答
  •  一生所求
    2020-12-01 06:45

    For anyone that is still confused, it is all explained in great detail here

    If your app includes a custom backend server, ID tokens can and should be used to communicate securely with it. Instead of sending requests with a user’s raw uid which can be easily spoofed by a malicious client, send the user's ID token which can be verified via a Firebase Admin SDK (or even a third-party JWT library if Firebase does not have an Admin SDK in your language of choice). To facilitate this, the modern client SDKs provide convenient methods for retrieving ID tokens for the currently logged-in user. The Admin SDK ensures the ID token is valid and returns the decoded token, which includes the uid of the user it belongs to as well as any custom claims added to it.

提交回复
热议问题