kavachOS
Authentication

Dropbox

Sign in with Dropbox using OAuth 2.0.

Setup

Get credentials

Go to the Dropbox App Console and create an app. Under OAuth 2, add your redirect URI:

https://your-app.com/api/kavach/auth/oauth/callback/dropbox

Configure

lib/kavach.ts
import { createKavach } from 'kavachos';
import { oauth } from 'kavachos/auth';
import { dropboxProvider } from 'kavachos/auth';

const kavach = await createKavach({
  database: { provider: 'sqlite', url: 'kavach.db' },
  plugins: [
    oauth({
      providers: [
        dropboxProvider(
          process.env.DROPBOX_CLIENT_ID!,
          process.env.DROPBOX_CLIENT_SECRET!,
        ),
      ],
    }),
  ],
});
DROPBOX_CLIENT_ID=...
DROPBOX_CLIENT_SECRET=...

Scopes

Default scopes: account_info.read

ScopeWhat it unlocks
account_info.readRead the user's account info
files.metadata.readList file metadata
files.content.readRead file contents

Endpoints

MethodPathDescription
GET/auth/oauth/authorize/dropboxRedirect to Dropbox
GET/auth/oauth/callback/dropboxHandle callback

On this page