问题
I am working on an Ionic 3 application where i have used google firebase for login. So, i needed to verify the firebase token in my back-end. I have used FirebaseAdmin(Version 1.2.0) plugin for verifying the token.
try
{
var firebaseAppInstance = FirebaseApp.GetInstance(firebaseAppName);
if (firebaseAppInstance == null)
{
firebaseAppInstance = FirebaseApp.Create(new AppOptions()
{
Credential = GoogleCredential.FromFile("firebase-servicekey.json")
}, firebaseAppName);
}
var decodedToken = await FirebaseAuth.GetAuth(firebaseAppInstance).VerifyIdTokenAsync(firebaseToken);
if (userId == decodedToken.Uid)
{
return true;
}
}
catch (Exception e)
{
return false;
}
But, sometimes i am getting Firebase ID token issued at future timestamp error. And sometimes, i could verify the same firebase token without this error.
Can anyone point me out what's the problem here? Thanks in advance.
回答1:
The issue has been resolved here. Just need to update the new release of that package. Here is the release notes
来源:https://stackoverflow.com/questions/54891883/firebase-id-token-issued-at-future-timestamp-error-in-firebaseadmin-asp-net-sdk