有谁知道增加 Firebase token 的到期时间?我正在使用 Firebase/php-jwt。关注custom token generation documentation .当我将时间增加到超过 3600 时, token 变得无效。谁能帮帮我?
$now_seconds = time();
$payload = array(
"iss" => $service_account_email,
"sub" => $service_account_email,
"aud" => "https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.IdentityToolkit",
"iat" => $now_seconds,
"exp" => $now_seconds+(60*60), // Maximum expiration time is one hour
"uid" => $uid,
"claims" => array(
"premium_account" => $is_premium_account
)
);
return JWT::encode($payload, $private_key, "RS256");
最佳答案
来自documentationon creating custom tokens :
exp
- Expiration timeThe time, in seconds since the UNIX epoch, at which the token expires. It can be a maximum of 3600 seconds later than the
iat
.
目前无法对 Firebase 身份验证 ID token 使用更长的有效期。
关于php - 如何增加 Firebase token 的到期时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45164233/