使用访问令牌的Android Dropbox API v2自动访问 [英] Android Dropbox API v2 auto access using access token

查看:89
本文介绍了使用访问令牌的Android Dropbox API v2自动访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在android API v1中,我可以传递不需要登录到Dropbox的访问令牌。您可以在api v2中让我知道该怎么做吗?

In android API v1 I am able to pass access token through which I didn't need to login to Dropbox. In api v2 can you please let me know how to do that?

在API v2中,无需以下代码即可自动访问-

In API v2 auto access can be done without the following code -

Auth.startOAuth2Authentication(MainActivity.this, Constants.APP_KEY);

请给我提供任何解决方案。

Please provide me any solution.

推荐答案

是的,使用Dropbox API v2 Java SDK,您仍然可以直接提供访问令牌,而无需启动授权流程。

Yes, using the Dropbox API v2 Java SDK, you can still directly supply an access token without starting the authorization flow.

为此,您可以使用 DbxClientV2 构造函数,它直接采用OAuth 2访问令牌。

To do so, you can use a DbxClientV2 constructor that takes an OAuth 2 access token directly.

请注意,仍然强烈建议不要为a。中的特定帐户分配访问令牌客户端应用程序,如这篇文章中所述

Note that it is still highly discouraged to distribute access tokens for a particular account in a client-side app, as discussed in this post.

这篇关于使用访问令牌的Android Dropbox API v2自动访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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