Skip to content
Back to catalog
Dropbox

OAuth with Dropbox

Authenticate users with an existing Dropbox account

Dropbox is a cloud storage service that people and teams use to store, sync, and share files across their devices. Its API lets apps read and write files in a user's Dropbox with the user's permission.

How does the integration work?

You can use the Dropbox OAuth adapter in Appwrite Auth to let users sign in with their Dropbox account. This fits apps that work with files in Dropbox, such as file pickers, backup tools, and document workflows. The session stores Dropbox's access token as providerAccessToken, so your server can call the Dropbox API on the user's behalf.

Appwrite reads the user's account with Dropbox's users/get_current_account endpoint and stores their name, email, and profile photo. It marks the email as verified only when Dropbox reports email_verified as true.

How to implement

To implement the Dropbox OAuth adapter in Appwrite Auth, there are several steps you must complete:

Step 1: Create an app in the Dropbox App Console

Open the Dropbox App Console and click Create app. Choose Scoped access, pick the type of access your app needs, give it a name, and create the app.

On the app's Permissions tab, keep account_info.read enabled. Appwrite requests no extra scopes, so the permissions on this tab decide what the access token can do, and account_info.read is what lets Appwrite read the user's profile and email. Add file scopes only if your app calls the Dropbox API for files.

On the Settings tab, save the App key and App secret for later use. You'll add the redirect URI under OAuth 2 after you configure Appwrite in the next step.

Step 2: Add Dropbox OAuth adapter to your Appwrite project

For this step, you must create an account on Appwrite Cloud or self-host Appwrite if you haven't already. In your Appwrite project, head over to the Auth page, open the Settings tab, and click Dropbox under the OAuth2 Providers section.

Paste the app's credentials into the App Key and App Secret fields, turn the provider on, and click Update.

Copy the Redirect URI shown in the form. On Appwrite Cloud it looks like https://<REGION>.cloud.appwrite.io/v1/account/sessions/oauth2/callback/dropbox/<PROJECT_ID>, but always copy the exact value from the Console. In the Dropbox App Console, add it to Redirect URIs under OAuth 2 on the app's Settings tab.

New Dropbox apps start in development status, which limits how many users can link the app. Apply for production status in the App Console before you launch.

Step 3: Test the provider

Start a session from your app with the OAuthProvider.Dropbox value. With the Web SDK:

JavaScript
import { Client, Account, OAuthProvider } from 'appwrite';
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>');
const account = new Account(client);
account.createOAuth2Session({
provider: OAuthProvider.Dropbox,
success: 'https://example.com/success',
failure: 'https://example.com/failed',
});

Add your app's domain as a web platform in your Appwrite project so Appwrite accepts the success and failure URLs. Follow the OAuth 2 login flow for other platforms and for server-side sign-in.

Read more about Dropbox and Appwrite Auth

If you would like to learn more about Dropbox and Appwrite Auth, we have some resources that you should visit:

Technology Partner Program

Building on Appwrite?

Teams and developers who ship integrations, tools, or services on Appwrite can join our partner program for verified catalog placement, co-marketing, training, and engineering support.