[GH-ISSUE #3358] Can't pass token_access_type to dropbox provider? No way to get refresh token? #9578

Closed
opened 2026-04-13 05:06:26 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @ehahn9 on GitHub (Jul 12, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3358

Is this suited for github?

  • Yes, this is suited for github

Hi! Probably newbie err, but it appears that the dropbox social provider doesn't support setting token_access_type=offline, nor does it seem to honor authorizationURLParams in the options. Alas, together, these perhaps make it impossible to request a refresh token?

Happy to make a pull request for a trivial update to social-providers/dropbox.ts - I'm new at this, tho!

Describe the solution you'd like

Something like this:

-export interface DropboxOptions extends ProviderOptions<DropboxProfile> {}
+export interface DropboxOptions extends ProviderOptions<DropboxProfile> {
+       token_access_type?: 'offline',
+}
 
 export const dropbox = (options: DropboxOptions) => {
        const tokenEndpoint = "https://api.dropboxapi.com/oauth2/token";
@@ -37,6 +39,10 @@ export const dropbox = (options: DropboxOptions) => {
                        const _scopes = options.disableDefaultScope ? [] : ["account_info.read"];
                        options.scope && _scopes.push(...options.scope);
                        scopes && _scopes.push(...scopes);
+
+                       const additionalParams: Record<string, string> = {};
+                       if (options.token_access_type === 'offline') additionalParams.token_access_type = 'offline';
+
                        return await createAuthorizationURL({
                                id: "dropbox",
                                options,
@@ -45,6 +51,7 @@ export const dropbox = (options: DropboxOptions) => {
                                state,
                                redirectURI,
                                codeVerifier,
+                               additionalParams,
                        });
                },
                validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => {

Describe alternatives you've considered

I've tried working around this by making my own dropbox provider using the genericOAuth base, but that has it's own problems (I think there's a problem with dropbox's pkce config which breaks using genericOAuth).

Additional context

No response

Originally created by @ehahn9 on GitHub (Jul 12, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3358 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Hi! Probably newbie err, but it appears that the dropbox social provider doesn't support setting `token_access_type=offline`, nor does it seem to honor `authorizationURLParams` in the options. Alas, together, these perhaps make it impossible to request a refresh token? Happy to make a pull request for a trivial update to `social-providers/dropbox.ts` - I'm new at this, tho! ### Describe the solution you'd like Something like this: ```ts -export interface DropboxOptions extends ProviderOptions<DropboxProfile> {} +export interface DropboxOptions extends ProviderOptions<DropboxProfile> { + token_access_type?: 'offline', +} export const dropbox = (options: DropboxOptions) => { const tokenEndpoint = "https://api.dropboxapi.com/oauth2/token"; @@ -37,6 +39,10 @@ export const dropbox = (options: DropboxOptions) => { const _scopes = options.disableDefaultScope ? [] : ["account_info.read"]; options.scope && _scopes.push(...options.scope); scopes && _scopes.push(...scopes); + + const additionalParams: Record<string, string> = {}; + if (options.token_access_type === 'offline') additionalParams.token_access_type = 'offline'; + return await createAuthorizationURL({ id: "dropbox", options, @@ -45,6 +51,7 @@ export const dropbox = (options: DropboxOptions) => { state, redirectURI, codeVerifier, + additionalParams, }); }, validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => { ``` ### Describe alternatives you've considered I've tried working around this by making my own dropbox provider using the genericOAuth base, but that has it's own problems (I think there's a problem with dropbox's pkce config which breaks using genericOAuth). ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 05:06:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9578