回归:OAuth无效范围(Google环聊-环聊库) [英] Regression: OAuth Invalid Scope (Google Hangouts - Hangups Library)

查看:109
本文介绍了回归:OAuth无效范围(Google环聊-环聊库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法获得一个OAuth URI的访问令牌,该令牌一直有效到8月底,并被各种客户端使用.

到目前为止,这是第三方客户的普遍问题:

因此,目前,无法通过 hangups .现在它因以下错误而失败:

以下是创建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更改,这些更改终止了挂断进行首次登录的方式:查看问题这里这里

现有的漫游器也会在其令牌过期后立即停止工作找到本文.

那么,我们如何访问用于访问环聊的授权码?

解决方案

使用下面的网址

7.在右侧面板中向下滚动,找到"set-cookie"
8.您的代码应在"oauth_code =之后,直到但不包括分号在内.
9.复制并使用.

It is impossible to obtain an access token with an OAuth URI which worked until the end of August, and which is used by various clients.

It's a general issue with third party clients as of now:

Thus, currently, it is impossible to use a Google Hangouts Chat Bot (third party application) using hangups. It now fails with this error:

Here is how URI created to access Google OAuth with Python :

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 has made some OAuth changes that killed the way hangups does its initial login: see issue here and here

Existing bots will also stop working as soon as their tokens expire find this article.

So, how can we access the Authorization Code for accessing Hangouts?

解决方案

Using the urls below

https://accounts.google.com/o/oauth2/programmatic_auth?hl=en&scope=https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthLogin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&client_id=936475272427.apps.googleusercontent.com&access_type=offline&delegated_client_id=183697946088-m3jnlsqshjhh5lbvg05k46q1k4qqtrgn.apps.googleusercontent.com&top_level_cookie=1

you can get to a programmatic_auth url that sets the oauth code to a cookie that contains the oAuth code.

How to do:
1. Go to the above url
2. Enter your username, click next.
3. Right click page background, inspect
4. Go to the network tab.
5. Enter your password, click sign in
6. Click the first row, the one that says "programmatic_auth"
7. Scroll down in the right-side panel, find "set-cookie"
8. Your code should be there, after "oauth_code=", up to but not including the semicolon.
9. Copy it and use it.

这篇关于回归:OAuth无效范围(Google环聊-环聊库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆