我正在根据自己的帐户编写Dropbox集成。当文件删除时,我会响应网络钩通知,并将文件导入我们的后端系统之一。
来让我登录。
这一切都是在后端服务器代码中完成的,没有真正的机会弹出UI 小时。
将API与您自己的帐户一起使用时,是否有任何身份快捷方式?
I'm writing a dropbox integration against my own account. When file get dropped I respond to a webhook notification and import the files into one of our backend systems.
It's all done in back end server code and there is no real opportunity to pop up a UI to get me to sign in.
I've developed it so far using the access token you can get from the app console but that expires after a few hours.
Are there any auth shortcuts when using the API with just your own account?
发布评论
评论(1)
我首先为自己弄清楚了一些快捷方式,
因为它是一个背景过程,它需要使用“离线”访问权限并使用刷新令牌来获取短暂的“访问令牌”。
由于没有UI,并且仅适用于我自己的帐户,因此我可以通过此url
app id ex e shere}}}}& token_access_type = offline =离线
从浏览器获得授权代码。 rel =“ nofollow noreferrer”> https://www.dropbox.com/oauth2/authorize?client_id = 访问令牌&刷新令牌:
这会通过access_token产生结果,并且刷新_token
只有在我撤回访问权限的情况下才会到期,因此可以安全地添加到我的配置中,并用于请求访问令牌或连接到客户端。
在我的情况下,它的c#
I've figured out some shortcuts for myself
First off all as its a background process it needs to be running with "offline" access and using refresh tokens to acquire short lived access tokens.
As there is no UI and its only for my own account I can get an authorisation code via the browser from this URL
https://www.dropbox.com/oauth2/authorize?client_id={{Your APP ID Here}}&token_access_type=offline&response_type=code
then use POSTMAN to get an access Token & Refresh Token:
This produces a result with an access_token and a refresh_token
The refresh token will only expire if I withdraw access so that will be safe to add into my config and use to request access tokens or connect to the client.
In my case its c#