Skip to main content
Hostwares

How to Add Google Login with Supabase Auth

sowad sheikh··1 min read

Email and password authentication isn't the only option available to modern applications. Google login can make account creation easier for users. Supabase Auth supports OAuth providers, including Google.

Create Your Google OAuth Credentials

Start by creating the required OAuth configuration in Google's developer platform. You'll receive the credentials needed to identify your application.

Configure Supabase

Open the authentication provider settings in Supabase. Enable Google and add the required credentials. You'll also need to configure the appropriate redirect URL.

Add the Login Button

Your frontend can display a simple button such as:

Continue with Google

When the user clicks it, call the Supabase authentication method for Google OAuth.

Handle the Redirect

After Google authenticates the user, the browser returns to your configured callback URL. Your application can then access the authenticated session.

Test Different Scenarios Test: New users Existing users Logout Failed authentication Redirect handling

OAuth configuration is sensitive to URLs, so make sure your development and production redirect settings are correct.

Ready to deploy?

Launch your app on Hostwares — start for $1.00/mo with auto-scaling & global CDN.

Start for $1.00/mo

Ready to deploy? Start for $1.00/mo

Deploy now