While following this tutorial on using OAuth 2 with the Android AccountManager, I'm told that when specifying the AUTH_TOKEN_TYPE, instead of specifying the scope like this:
String AUTH_TOKEN_TYPE = "oauth2:https://www.googleapis.com/auth/tasks";
you can use its alias:
String AUTH_TOKEN_TYPE = "Manage your tasks";
This allows for a user to understand what the permissions are about instead of being given a URL. I am trying to figure out what the alias would be for the Google Documents List API.
The document then points to a list of auth token aliases, which unfortunately does not exist. There is also a related Youtube video in which the developer mentions a Google Buzz alias and also mentions that a list of aliases will be set up at some point.
What can I use instead of the Google Docs scope?
String AUTH_TOKEN_TYPE = "oauth2:https://docs.google.com/feeds/"
I found this list which seems to contain possible aliases for the auth token type for various Google services: http://code.google.com/intl/ja/apis/gdata/faq.html#clientlogin
Although it is not particular user-friendly, it seems like you may be able to use 'writely' as the alias for retrieving the documents list. A Google search for
AUTH_TOKEN_TYPE = 'writely';
returns a few results, which looks promising!I'm attempting to access Google Drive, not Docs, but here's what I entered for an Authorization Token Type:
DriveScopes is a list of possible authorization scopes. DriveScopes.DRIVE is the specific string from the list that gets me the particular scope I want. (It returns "https://www.googleapis.com/auth/drive".)
I append "oauth2:" to the front to specify that I want an Oauth2 token.
This code causes the user to be asked permission for "Your Drive to be Managed" or something like that. It didn't pop up revealing the address.
Hope this helps someone else find the similar code they need to find their own AUTH_TOKEN_TYPE. (Maybe in your case try DocScopes or DocsScopes, insert a period and see what Eclipse suggests as autocomplete?)
Supposedly this has been fixed in Ice Cream Sandwich (haven't been able to test it yet): https://plus.google.com/u/0/112215288642007559493/posts/Zme5LNLwCDP
I suppose that you could use the short names in Gingerbread, and plain names in ICS.