AUTH_TOKEN_TYPE对谷歌的API [英] AUTH_TOKEN_TYPE for Google API's

查看:296
本文介绍了AUTH_TOKEN_TYPE对谷歌的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好了,所以我知道如何获得帐户的列表,以便我可以让用户进行身份验证我的应用程序与谷歌的数据使用,但是,我是在怎样使用我的 AUTH_TOKEN_TYPE困惑

Okay, so I know how to get a list of accounts so that I can let the user authenticate my app to use with their Google Data, however, I am confused on what to use for my AUTH_TOKEN_TYPE.

下面是当前code,我有:

Here is the current code that I have:

AccountManager.get(this).getAuthTokenByFeatures("com.google", AUTH_TOKEN_TYPE, null, this, null,null)

我不知道在哪里可以找到 AUTH_TOKEN_TYPE 的,我想用(以及其他所有谷歌的API)将Picasa API。任何帮助吗?

I don't know where to find the AUTH_TOKEN_TYPE for the Picasa API that I want to use (along with all the other Google API's). Any help?

推荐答案

AUTH_TOKEN_TYPE是API的OAuth范围,也可以使用。对于客户经理,以了解它是你需要将其追加OAuth2.0用户的oauth2。因此,例如,对于任务的API会是这个样子。

AUTH_TOKEN_TYPE is the OAuth scope for the API, to be used. For account manager to understand that it is an OAuth2.0 you need to append it by "oauth2:". So for example for tasks API it will look something like this.

String AUTH_TOKEN_TYPE = "oauth2:https://www.googleapis.com/auth/tasks";

和Picasa的将是

String AUTH_TOKEN_TYPE = "oauth2:https://picasaweb.google.com/data/"

编辑:一些谷歌的API提供书面到位的OAuth2整个范围,使用特殊的别名字符串。例如这里是在AUTH_TOKEN_TYPE别名谷歌任务API。

Some of the Google APIs provide use of special alias strings in place of writing entire OAuth2 scope. For example here is the AUTH_TOKEN_TYPE alias for the Google Tasks API.

这篇关于AUTH_TOKEN_TYPE对谷歌的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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