PHP Gmail API无效授权:代码已被兑换(Codeigniter)

时间:2015-10-13 10:08:58

标签: php codeigniter gmail gmail-api

首先,我想说我读了关于同样问题的所有其他帖子,但我找不到解决方案。

这是错误:

  

例外' Google_Auth_Exception'消息'提取OAuth2访问令牌时出错,消息:' invalid_grant:代码已被兑换。

在localhost中,它完美无缺。我可以调试它,我得到Google plus&&电子邮件信息没有问题。

我为生产创建了一个新的凭证(Web App),并将我的oauth返回uri设置为:授权重定向URI (http://www.__myweb_.com/plus_gmail/oauth2callback

它有效,因为我可以接受并且我在回调中获取代码,但是当我尝试进行身份验证时它失败了;

我也试过revokeToken,我的Session是空的......

我该如何解决这个问题?

非常感谢!!

这是我的代码:

# (note the last ``1`` at the end to limit the substitution only to the first occurrence)
output = re.sub(r"(?s)<Location>.*?</Location>", r"%s" % locUpdate, xml, 1)

我还需要知道为什么它会向我显示var_dump($ e),但是我的数据库中有一个用户google plus信息的新行。

我在我的Gmail帐户(https://security.google.com/settings/security/permissions)中删除了对我的应用的访问权限,并再次授予获取相同错误的访问权限(代码已被兑换)。我使用了一个新的Gmail帐户,我也得到了同样的错误......

0 个答案:

没有答案