cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

authentication problem on java api

authentication problem on java api

contato_augify
New member | Level 2

I'm trying to integrate the Dropbox API into the backend of my application, however, the authentication part is a difficult task to do, because, following the documentation, authentication must be done by authorizing through the browser, which is not an option, since the project will run on the server and this process will be transparent to the client

1 Reply 1

Greg-DB
Dropbox Staff

It is not possible to completely automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. The authorization step needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.

 

You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this post which may serve as a useful example.

 

The official Dropbox Java SDK can actually handle the process for you automatically, e.g., as shown retrieved in this example, and then used as shown in this example . 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?