Firebase ID token issued at future timestamp Error in FirebaseAdmin ASP.NET SDK

痞子三分冷 提交于 2020-01-05 08:36:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!