PHP: Dropbox API OAuth Setup, Auth Process

May 31, 2022

Once we have our Dropbox App created, and our php script files implemented we can run the authorization process.


We start by opening the first file oauth-step1.php on a web browser.

http://localhost/dropbox-api/oauth-step1.php


First page


When we click on the "Authorize Dropbox" link on our first page, we will be redirected to Dropbox website where we can sign in.


Sign in on Dropbox


As the Dropbox App that we created is in "Development Status we will be showed up the following warning screen. This screen will not be showed when the App is upgraded to "Production Status"


Warning message


In the following page we will see the name of our Dropbox App, as well as the permissions our App is requesting from the Dropbox user.

To continue we click on the "Allow" button.


Allow App


After that we will be redirected back to our site (localhost) and will see the "Authorization Successful" message.

At this point, our script would have received the response from Dropbox containing the access_token and refresh_token that we would have also stored in our database.


Authorization Successful



This completes the setup of the Dropbox API OAuth process. In future posts we will show how to use the API to upload and download files to/from Dropbox.