[GH-ISSUE #2168] Allow to select wanted scopes on Google provider #9078

Closed
opened 2026-04-13 04:22:53 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Et3rnel on GitHub (Apr 7, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2168

Is this suited for github?

  • Yes, this is suited for github

It would be nice to be able to add the wanted scopes on the Google provided.
Example:

    socialProviders: {
        google: { 
            clientId: process.env.GOOGLE_CLIENT_ID, 
            clientSecret: process.env.GOOGLE_CLIENT_SECRET,
            // Add YouTube Upload scope
            scopes: [
                'https://www.googleapis.com/auth/youtube.upload'
            ],
        }, 
    },

I think it's not possible yet.
If I'm correct, I'll check if it's possible to do a PR to achieve that

Describe the solution you'd like

    socialProviders: {
        google: { 
            clientId: process.env.GOOGLE_CLIENT_ID, 
            clientSecret: process.env.GOOGLE_CLIENT_SECRET,
            // Add YouTube Upload scope
            scopes: [
                'https://www.googleapis.com/auth/youtube.upload'
            ],
        }, 
    },

Describe alternatives you've considered

An alternative would be to use Generic Oauth.

Additional context

No response

Originally created by @Et3rnel on GitHub (Apr 7, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2168 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. It would be nice to be able to add the wanted scopes on the Google provided. Example: ```ts socialProviders: { google: { clientId: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, // Add YouTube Upload scope scopes: [ 'https://www.googleapis.com/auth/youtube.upload' ], }, }, ``` I think it's not possible yet. If I'm correct, I'll check if it's possible to do a PR to achieve that ### Describe the solution you'd like ```ts socialProviders: { google: { clientId: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, // Add YouTube Upload scope scopes: [ 'https://www.googleapis.com/auth/youtube.upload' ], }, }, ``` ### Describe alternatives you've considered An alternative would be to use [Generic Oauth](https://www.better-auth.com/docs/plugins/generic-oauth). ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 04:22:53 -05:00
Author
Owner

@Et3rnel commented on GitHub (Apr 7, 2025):

Nevermind, it's not written in Google provider documentation but it's working using the scope key instead of scopes 👍

I'll update the documentation directly.

<!-- gh-comment-id:2783652497 --> @Et3rnel commented on GitHub (Apr 7, 2025): Nevermind, it's not written in [Google provider documentation](https://www.better-auth.com/docs/authentication/google) but it's working using the `scope` key instead of `scopes` 👍 I'll update the documentation directly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9078