logoBuildBox

Google Oauth

  1. Create a new project on Google Cloud

  2. Go to APIs & Services then Credentials

  3. Click [Configure Consent Screen]

  4. Make sure to edit privacy policy & terms of service with your information

  5. Go to Credentials and click [+ Create Credentials] then [Oauth Client ID]

  6. Choose [Web Application]. Add http://localhost:3000 and https://your-project.supabase.co to Authorized JavaScript origins. Add https://your-project.supabase.co/auth/v1/callback to Authorized redirect URIs (if you're using a subdomain like www, make sure to add it too). Click [Create]

  7. Copy paste the Client ID in GOOGLE_ID and Client Secret in GOOGLE_SECRET to your Supabase dashboard (Authentication > Providers > Google)

  8. In Supabase, go to [Authentication] then [URL Configuration] and add http://localhost:3000 to [Site URL]. Then add http://localhost:3000/* to [Redirect URLs].

  9. Go to [Oauth Consent Screen] and click [Publish App] then submit for verification. Click [Prepare for verification] and fill the missing information. Google will email you and you will have to reply to start the process. You'll need to have your domain verified with Google Search Console. You can go ahead and do that now. You can already login with Google on localhost. On production, it will work too but show a warning until you're verified (takes a few days).

Going to production?

In Supabase dashboard, go to [Authentication] then [URL Configuration] and add https://your-domain.com to [Site URL]. Then add https://your-domain.com/* to [Redirect URLs].

Last updated on

On this page

No Headings
Edit on GitHub