Dropbox social login
Users authenticate through their existing Dropbox accounts instead of creating a separate application password.
Auth.js · Const
The Dropbox provider is a built-in Auth.js OAuth integration. Configure it with Dropbox client credentials and add the resulting provider to the Auth.js providers array.
Call the Dropbox provider factory with OAuth client credentials and include its result in Auth.js's providers array. Auth.js supplies the default OAuth 2 configuration, while the callback endpoint must match the provider's configured redirect URL.
Dropbox(options): OAuthConfig<Record<string, any>>| Name | Type | Description |
|---|---|---|
options | OAuthUserConfig<Record<string, any>> | OAuth provider options, including Dropbox client credentials and any supported OAuth configuration overrides. |
OAuthConfig<Record<string, any>>
/api/auth/callback/dropbox in the documented example.import { Auth } from "@auth/core"
import Dropbox from "@auth/core/providers/dropbox"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Dropbox({
clientId: process.env.DROPBOX_CLIENT_ID,
clientSecret: process.env.DROPBOX_CLIENT_SECRET,
}),
],
})This configures Auth.js with Dropbox by supplying the OAuth client credentials.
Users authenticate through their existing Dropbox accounts instead of creating a separate application password.
An application needs several identity providers in one Auth.js setup.
A deployment requires provider-specific OAuth settings beyond the built-in defaults.
Use the Dropbox provider factory in the Auth.js providers array and pass the Dropbox client ID and client secret. Auth.js then uses the provider's built-in OAuth configuration.
Follow-up: How would you customize behavior? Override the built-in OAuth provider configuration using the customization approach documented by Auth.js.
The callback URL is https://example.com/api/auth/callback/dropbox. The Dropbox application must be configured to redirect to the matching callback endpoint.
Follow-up: What must be checked if the callback fails? Verify that the registered redirect URL exactly matches the endpoint and deployment base URL.
The factory accepts an OAuth user configuration object and returns an OAuth provider configuration. In normal usage, the required values are the Dropbox client ID and client secret.
Follow-up: Why does the return type matter? Auth.js consumes the returned OAuth configuration as one provider in its authentication setup.
OAuthConfigOAuthUserConfigAuthproviderscustomizing a built-in OAuth provider