Access dropbox api without clientside authentication?

泪湿孤枕 提交于 2019-12-23 09:17:00

问题


I'm trying to create a smooth solution for sharing files with a custom presentation of the files (logos fonts etc).

My ideal would be to put the files in a dropbox folder and then have a webpage, on a separate server, access those files over javascript and display a list of them linked to the actual files.

A demand is that the end user don't have to authenticate with a dropbox acocunt in order to access the files. I would rather like to use a public folder or use files from another account.

Is there any way to maintain a auth-session serverside, something like a permanent sessionID or something like that?


回答1:


Just do the authentication one time, approve your app, get your authentication key, and in the code:

$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
$accountInfo = $dbxClient->getAccountInfo();
print_r($accountInfo);

Change:

$accessToken to "{Your auth key}"

or put the line:

$accessToken = "{authentication code here}";

above that code.



来源:https://stackoverflow.com/questions/19636124/access-dropbox-api-without-clientside-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!