早上好,不确定这是否是正确的地方,但是在使用我们的安装屏幕时,oAuth窗口不断闪烁,我们向我们报告了几个问题。我们已经调试了这个尝试以获得许多范围,并将其缩小到范围:
https://www.googleapis.com/auth/plus.login
来自https://www.googleapis.com/discovery/v1/apis/drive/v3/rest的回复未返回我们要求的范围。
此前有效,但现在似乎造成了问题。你知道有什么改变可能会影响这个或者有什么简单的方法可以修复吗? 这是我获得范围和请求权限的号召:
'apiKey': '---------',
'discoveryDocs': [discoveryUrl],
'clientId': '--------.apps.googleusercontent.com',
'scope': SCOPE
}).then(function () {
GoogleAuth = gapi.auth2.getAuthInstance();
GoogleAuth.signOut();
// Listen for sign-in state changes.
GoogleAuth.isSignedIn.listen(updateSigninStatus);
// Handle initial sign-in state. (Determine if user is already signed in.)
var user = GoogleAuth.currentUser.get();
setSigninStatus();
});
在此过程的后期,我们检查用户现在是否获得了请求范围:
var user = GoogleAuth.currentUser.get();
var isAuthorized = user.hasGrantedScopes(SCOPE);
如果没有,我们会重新检查,以防获得权限延迟。
很抱歉,如果我还没有提供所有信息,如果您需要更多信息,请告知。
由于
答案 0 :(得分:0)
让我们看看你的范围
googleapis.com/auth/userinfo.email
googleapis.com/auth/userinfo.profile
googleapis.com/auth/plus.me
googleapis.com/auth/drive.readonly
googleapis.com/auth/drive.apps.readonly
googleapis.com/auth/drive
googleapis.com/auth/plus.profile.agerange.read
googleapis.com/auth/plus.profile.language.read
我不确定这是否是您问题的原因,但可能没有帮助 我认为你应该查阅范围页面here
googleapis.com/auth/drive.readonly
googleapis.com/auth/drive.apps.readonly
googleapis.com/auth/drive
云端硬盘可让您访问View and manage the files in your Google Drive
,这意味着两个只读的内容毫无意义。
这两个也是一样的
googleapis.com/auth/userinfo.profile
googleapis.com/auth/plus.me
与
相同googleapis.com/auth/plus.login
您可以使用oauth playground来测试您是否有权访问所需内容。而不仅仅包括许多额外的范围。
答案 1 :(得分:0)
这看起来像谷歌的改变。
当您请求https://www.googleapis.com/auth/plus.login
时,您现在实际收到了https://www.googleapis.com/auth/plus.me
范围。
重现的步骤:
https://www.googleapis.com/auth/plus.login
范围并交换代码以获取访问令牌。https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/plus.profile.agerange.read https://www.googleapis.com/auth/plus.profile.language.read https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/plus.login
,您的应用现已损坏。这似乎是最近发生的(过去24小时内),因此可能是谷歌结束时的缺陷或一些无证的变更。
我们通过对https://www.googleapis.com/auth/plus.me
希望这有帮助。