Search code examples
google-oauthsupabase

Is there a way to add user's consent to access their phone number, birthdate and gender data using google oAuth in supabase?


I am using supabase to log my users in with google:

const { data, error } = await auth.signInWithOAuth({
            provider: 'google',
            options: {
                queryParams: {
                    access_type: 'offline',
                    prompt: 'consent',
                },
                scopes: 'profile birthdate gender phone',
                redirectTo: window.location.origin + '/api/login',
            },
        });

However I want to know if there's a way to ask user for consent to share their birthdate, gender and phone number? Or do I have to do it separately via some other google API?


Solution

  • email, profile, and openid are the available scopes for Google login. profile scope may or may not contain the information you want from the user.

    https://developers.google.com/identity/protocols/oauth2/scopes#oauth2