无法再获取OAuth2访问令牌:invalid_scope错误

Pat*_*ark 6 google-api oauth-2.0 google-oauth google-oauth2

我使用React Native Framework编写了一个移动应用程序.

此应用程序使用Google的OAuth 2.0端点授权访问Google API.

我按照文档来实现这一点.

通过发出以下HTTP请求,我已经能够在几个月内检索访问令牌和刷新令牌:

HTTP GET请求检索授权码:

https://accounts.google.com/o/oauth2/v2/auth?scope=email%20profile%20https://www.googleapis.com/auth/youtube%20https://www.googleapis.com/auth/yt-analytics.readonly%20https://www.googleapis.com/auth/yt-analytics-monetary.readonly%20https://www.googleapis.com/auth/youtubepartner&response_type=code&client_id=OMITTED&redirect_uri=OMITTED');
Run Code Online (Sandbox Code Playgroud)

HTTP POST请求以交换访问令牌的授权码:

let queryString = "code=" + authCode + "&" + "client_id=OMITTED&redirect_uri=OMITTED&grant_type=authorization_code";

fetch('https://www.googleapis.com/oauth2/v4/token', {method:'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }, body: queryString})
Run Code Online (Sandbox Code Playgroud)

此POST请求现在在响应中收到以下错误:

错误:

"invalid_scope"
error_description
:
"Some requested scopes were invalid. {valid=[https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/userinfo.profile, https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/yt-analytics.readonly, https://www.googleapis.com/auth/yt-analytics-monetary.readonly], invalid=[https://www.googleapis.com/auth/youtubepartner#]}"
Run Code Online (Sandbox Code Playgroud)

同样,我已经能够使用相同的代码检索访问令牌和刷新令牌数月.

截至09/12/2018,此错误突然出现.

我的代码没有变化.

有没有人对我为什么现在收到此错误有任何想法?

use*_*651 0

删除电子邮件范围怎么样?


我想谷歌现在已经修复了它。我现在可以在我的应用程序上登录而无需删除电子邮件范围。