问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/23086351/google-oauth-2-0-incremental-authorization-not-working