谷歌云- oauth2client.client.HttpAccessTokenRefreshError:无效授权刷新错误。

7

当我尝试执行Google预测API时,出现了这个错误消息。

raise HttpAccessTokenRefreshError(error_msg, status=resp.status)
oauth2client.client.HttpAccessTokenRefreshError: invalid_grant

我的凭证详细信息

{
    "scopes": [],
    "private_key": "XXXXX",
    "id_token": null,
    "token_uri": "https://accounts.google.com/o/oauth2/token",
    "token_info_uri": null,
    "token_response": null,
    "client_id": null,
    "scope": "https://www.googleapis.com/auth/prediction https://www.googleapis.com/auth/devstorage.read_only",
    "token_expiry": null,
    "_class": "SignedJwtAssertionCredentials",
    "refresh_token": null,
    "_module": "oauth2client.client",
    "private_key_password": "notasecret",
    "access_token": null,
    "service_account_name": "account-1@myapp-1136.iam.gserviceaccount.com",
    "invalid": false,
    "assertion_type": null,
    "kwargs": {},
    "client_secret": null,
    "revoke_uri": "https://accounts.google.com/o/oauth2/revoke",
    "user_agent": null
}

这是一个瞬态错误吗?通常这意味着您的访问令牌已过期,需要使用oauth2client.client.Credentials.refresh()进行刷新。 - Adam
你是否找到了解决这个问题的方法? - Adam
有些老旧的问题,但这篇回答帮助了我 https://dev59.com/wmoy5IYBdhLWcg3wcNrh#14288818 - Ernest Jumbe
1个回答

3

对于未来阅读此问题的读者,如果此问题发生在本地计算机上,可能是由于系统时钟不同步所致。否则,在发布此问题时,App Engine 也存在已知问题。有关两种原因的详细信息可以在 oauth2client GitHub 项目页面的问题报告中找到,该报告是去年发布的:

oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Bad Request


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接