Thanks for your reply, I did know about profile information/email request and I did use that. I also knew it was possible to request multiple scopes at the same time, which I also use (to have email + GoogleAnalytics).
What I'm trying to do is to allow our users to link multiple Google accounts to his account, give us only the necessary access to each of them and allow him to give us additional access in the future if his needs change. Is there a way to accomplish that?
My issue is that I cannot know, in advance, all the scopes/services the user will request so I cannot, for example, request AdWords + GoogleAnalytics up-front. Moreover, since our client's account can link to multiple Google accounts, it isn't possible to assume that hey would be reusing the same account they already linked and simply add the new scope to what we already have and make a new request. Finally since we cannot make a request for a specific account, even if we already have a refresh token, we cannot even ask the user to reuse one of his existing account.
Simon B.
On Friday, May 11, 2012 10:15:30 AM UTC-4, יניב ענבר Yaniv Inbar wrote:
Great questions!
As far as I know, it is not possible to request an access token for a specific account. It is however possible to request the name of the account associated with an access token. More information about that can be found at:
It is not possible to essentially widen scope of a refresh token. Storing a separate refresh token for each scope is possible but inadvisable. What we recommend instead is to request multiple scopes for each refresh token. The scope parameter can be a space-separated list of scopes. The Java client library actually takes in a variable list of scopes, so it takes care of space-separating it for you.
Let me know if you need to see more specifics, or if you have any follow up questions. If you have more general questions about OAuth 2 (like your question about requesting a token for a specific account), you can also try this Google Group:
Yaniv Inbar
Senior Software Engineer
Google Inc.