首页 > 解决方案 > 刷新令牌上的 Firebase REST API INVALID_ARGUMENT

问题描述

昨天我们开始遇到 REST API 的问题,尤其是刷新令牌方法:https ://firebase.google.com/docs/reference/rest/auth/#section-refresh-token

curl 'https://securetoken.googleapis.com/v1/token?key=[API_KEY]' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data 'grant_type=refresh_token&refresh_token=[REFRESH_TOKEN]'

我们使用文档上的 curl 示例和我们自己的开发(使用 PHP 和 Guzzle)尝试了这个调用,但我们总是得到这个错误:

"error": {
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT"
    }

标签: phprestfirebasefirebase-authentication

解决方案


当您从 Google 的数据中心内拨打电话时,似乎会发生这种情况,这对我们在本地运行良好。14 日,它也开始发生在我们身上。我向 firebase 团队提出了一个错误。


推荐阅读