Search code examples
jsonrestdropboxdropbox-api

Dropbox user authorization without invoking a web browser for login


I'm relatively new to the Dropbox APIs, so I apologize if I'm asking something simple.

I'm developing an application that will synchronize its database via the Dropbox Datastore APIs (or Sync APIs) but I can't seem to find a way to authorize a user for the Dropbox service connection. The only authorization that I was able to find is the /oauth2/authorize API, that according to the documentation will display a web page that will let user log in.

I am not really interested in displaying any web pages in my app (since it is not web based, nor that it has a web browser.) I just want to have my own UI incorporate the user name and password fields with the note Please log in to your Dropbox account where a user can type in their credentials. After which I could pass them to the Dropbox API call.

Is there such a way to authorize a user account?


Solution

  • By design, the Dropbox API doesn't allow this. (We don't want third-party apps to ever handle user credentials.)

    Note, though, that the user only has to do this authorization once. From then on, your app can continue to use the access token you got in the first place. The normal flow for a command-line app is to send the user to the browser to authorize and then copy/paste an access code into the console. The app then gets the access token and saves it for future use.