Google OAuth 2.0增量授权无法使用 [英] Google OAuth 2.0 incremental authorization not working

查看:161
本文介绍了Google OAuth 2.0增量授权无法使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要访问Google API组合的服务器端应用程序,对于我们的应用程序的某些用户,我们只需要访问一个API /一组示范程序(如Google Drive),其他用户可以访问另一个API / (例如G +),对于一些我们需要访问两者(用户可以在稍后链接到应用程序的其他部分)。



我们想要使用增量授权,但是当我们第一次请求访问一组范围,然后在请求访问另一组范围时,我们为第二个请求获得的访问令牌仅允许访问第二个范围,而不是最初请求的范围和新范围的组合,如上面给出的Google链接。



我们所有的授权网址都包含 include_granted_scopes = true 参数。

是否有任何其他步骤需要我们启用增量式身份验证?我们正在服务器端应用程序中使用Google oauth Java客户端库,如果这样做有任何区别的话。



这个问题描述了类似的问题,但是对于已安装的应用程序,它包括一个很好的简单脚本来重现问题。

解决方案

我们正在看到这个问题的一个变种。我们发现可以使用Drive API的作用域查找工作,但它不适用于Spreadsheets API。



已向Google提交问题



https://code.google.com/a/google .com / p / apps-api-issues / issues / detail?id = 3642& thanks = 3642& ts = 1412997212


I have a server-side application that needs access to a combination of Google APIs, for some users of our app we only need access to one API/set of scopes (say Google Drive), for other users to another API/scope (say G+), and for some we need access to both (users can link to the other part of the app at a later time).

We wanted to use incremental authorization for this, but when we first request access to one set of scopes, then later on request access to another set of scopes, the access token we get for that second request only allows access to the second scopes, not the combination of the initially requested scopes and the new scopes, as documented in the Google link given above.

All our authorization urls include the include_granted_scopes=true parameter.

Is there any additional step we have to do to enable incremental auth? We are using the Google oauth Java client libs in our server-side app, if that makes any difference.

This question describes a similar problem, but for an installed app, and it includes a nice simple script to reproduce the problem.

解决方案

We are seeing a variant of this problem. We found that things worked find with scopes for Drive APIs, but that it didn't work for the Spreadsheets API.

Have filed an issue with Google

https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3642&thanks=3642&ts=1412997212

这篇关于Google OAuth 2.0增量授权无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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