This document describes how to integrate Dropbox Single Sign-On (SSO) with your application. By following these instructions, you will be able to allow users to authenticate with Dropbox and access their Dropbox account information and files.
Before you start, you need to obtain the necessary credentials and set up environment variables:
- DROPBOX_CLIENT_ID: Your Dropbox OAuth client ID.
- DROPBOX_CLIENT_SECRET: Your Dropbox OAuth client secret.
To obtain the necessary credentials from Dropbox:
-
Create a Dropbox App:
- Visit the Dropbox App Console.
- Click on "Create App".
- Choose an API (Scoped access).
- Select the type of access you need: "Full Dropbox" or "App Folder".
- Name your app and click "Create App".
-
Get Your App Credentials:
- Navigate to the "Settings" tab of your app in the Dropbox App Console.
- You will find your
App key
(use this asDROPBOX_CLIENT_ID
) andApp secret
(use this asDROPBOX_CLIENT_SECRET
).
-
Set the Redirect URI:
- In the "OAuth 2" section in the settings tab, add your redirect URI (e.g.,
https://yourapp.com/auth/dropbox/callback
).
- In the "OAuth 2" section in the settings tab, add your redirect URI (e.g.,
When setting up OAuth access, ensure that you enable the following scopes:
account_info.read
: Required to access user account information.files.metadata.read
: Required to read the metadata for files in the user's Dropbox.
Add the following environment variables to your .env
file:
DROPBOX_CLIENT_ID=your_dropbox_client_id
DROPBOX_CLIENT_SECRET=your_dropbox_client_secret