0

I've got a server-hosted .NET app that will need to connect to a single Dropbox account (on a schedule) and just overwrite a file there. In looking at the Dropbox authentication types, it states the following:

App Authentication

This type only uses the app's own app key and secret, and doesn't identify a specific user or team. The app key and secret are transmitted in place of a username and password using "HTTP basic access authentication". Examples: When supplying the app key and secret for App Authentication, the app key and secret are given in place of the HTTP username and password, respectively. This can be done either as separate strings, as shown in the first two examples below, or as an base64-encoded Basic authorization string in the Authorization header, as in the third example below.

Example 1:
curl -X POST "https://api.dropbox.com/1/metadata/link" -u "<APP_KEY>:<APP_SECRET>" \
-d 
link="https://www.dropbox.com/sh/748egu7925f0gesq/AAHi80RJyhJFfkupnAU0wXuva?dl=0"

Example 2:
curl -X POST "https://<APP_KEY>:<APP_SECRET>@api.dropbox.com/1/metadata/link" \
-d 
link="https://www.dropbox.com/sh/748egu7925f0gesq/AAHi80RJyhJFfkupnAU0wXuva?dl=0"

Example 3:
curl -X POST "https://api.dropbox.com/1/metadata/link" \
--header "Authorization: Basic <base64(APP_KEY:APP_SECRET)>" \
-d "link=https://www.dropbox.com/sh/748egu7925f0gesq/AAHi80RJyhJFfkupnAU0wXuva?dl=0"

Great! So I know it can be done without the whole OAuth authentication flow.....However, I can't seem to figure out how to perform App Authentication via the Dropbox.NET SDK by just supplying the AppKey and AppSecret.

Anyone have a code example of how to perform Basic Auth rather than OAuth against Dropbox?

razaross444
  • 513
  • 4
  • 15
  • Why not just use the dropbox .net api instead of worrying about rest. – TheGeneral Feb 02 '19 at 00:46
  • That's what I'm trying to do.... I only quoted the documentation as proof that I know this is achievable.... I just don't know how to do it through the Dropbox.NET SDK, which is what I'm looking for help with. – razaross444 Feb 02 '19 at 01:34
  • You wouldn’t use an SDK for this. You’d use http client. – theMayer Feb 02 '19 at 01:42
  • [Cross-linking for reference: https://github.com/dropbox/dropbox-sdk-dotnet/issues/93 ] – Greg Feb 02 '19 at 23:17

0 Answers0