Skip to main content
Hostwares

Supabase OAuth Login: Connecting Google and GitHub Authentication

sowad sheikh··2 min read

Many users prefer signing in with an existing account rather than creating another password.

Supabase Auth supports OAuth providers such as Google and GitHub.

The Basic Flow

The authentication flow looks like:

User
 ↓
Your Application
 ↓
OAuth Provider
 ↓
Authentication
 ↓
Your Application

The provider verifies the user's identity.

Supabase then manages the resulting authentication session.

Configure the Provider

Before using OAuth, configure the provider and callback settings.

Your application needs the correct redirect URL for development and production.

Development vs Production

A common deployment mistake is configuring only the local URL.

For example:

localhost → Development
yourdomain.com → Production

Both environments may need appropriate redirect configuration.

User Profiles

After authentication, your application can maintain additional profile information in PostgreSQL.

For example:

user_id
display_name
avatar
company

Multiple Providers

An application can support more than one provider.

For example:

Continue with Google
Continue with GitHub

Users can then choose their preferred method.

Production Testing

Test:

  • First login
  • Returning login
  • Logout
  • Redirects
  • Invalid callback
  • Production domain

Final Thoughts

OAuth can remove friction from the signup process.

With Supabase Auth, applications can connect external identity providers while keeping application-specific data in PostgreSQL.

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