【发布时间】:2016-09-04 07:32:11
【问题描述】:
不可能通过 OAuth URI 获得访问令牌,该 URI 一直有效到 8 月底,并被各种客户端使用。
到目前为止,这是第三方客户的普遍问题:
因此,目前无法通过hangups 使用 Google Hangouts Chat Bot(第三方应用程序)。它现在失败并出现此错误:
以下是创建 URI 以使用 Python 访问 Google OAuth 的方式:
OAUTH2_SCOPE = 'https://www.google.com/accounts/OAuthLogin'
OAUTH2_CLIENT_ID = 'some_client_id'
OAUTH2_CLIENT_SECRET = 'some_client_screet'
OAUTH2_LOGIN_URL = 'https://accounts.google.com/o/oauth2/auth?{}'.format(
urllib.parse.urlencode(dict(
client_id=OAUTH2_CLIENT_ID,
scope=OAUTH2_SCOPE,
redirect_uri='urn:ietf:wg:oauth:2.0:oob',
response_type='code',
))
)
OAUTH2_TOKEN_REQUEST_URL = 'https://accounts.google.com/o/oauth2/token'
Google 进行了一些 OAuth 更改,取消了 hangups 的初始登录方式:see issue here 和 here
现有机器人也将在其令牌到期find this article 后立即停止工作。
那么,我们如何获取访问环聊的授权码呢?
【问题讨论】:
标签: python-3.x oauth-2.0 google-oauth google-hangouts hangouts-api