tutorial··5 min read·WoWSQL Team

Add Google, GitHub and Apple Login to Your App

Add Google, GitHub and Apple login to your app: provider console setup, the exact redirect URL, working SDK code, mobile tips and fixes for common errors.

To add Google, GitHub or Apple login without writing your own OAuth server, create an OAuth app in each provider's console, register your auth service's callback URL there, and let a hosted auth service such as WoWSQL Auth run the code exchange. With WoWSQL you paste the client ID and secret into Auth → Providers, call getOAuthAuthorizationUrl() from @wowsql/sdk, and read the session tokens on your landing page. The whole setup takes about 30 minutes per provider, most of it in the provider's console.

This tutorial walks through all three providers step by step, then the code, mobile apps, account linking and the errors people hit most. WoWSQL facts come from the OAuth for Projects docs and the @wowsql/sdk 3.10.0 typings, checked on 25 November 2026.

Key facts

  • WoWSQL Auth (docs): email and password, magic links, email or phone OTP, OAuth with 19 working providers, TOTP two-factor and optional Cloudflare Turnstile CAPTCHA. Anonymous sign-in is available when enabled (TypeScript SDK 3.10.0).
  • The 19 working OAuth providers (25 November 2026): Apple, Azure, Bitbucket, Discord, Facebook, Figma, GitHub, GitLab (gitlab.com only), Google, Kakao, LinkedIn, Microsoft, Notion, Slack, Spotify, Twitch, Twitter / X, WorkOS and Zoom. Keycloak is listed in the dashboard but not usable yet.
  • Callback URL to register with every provider: https://{slug}.wowsqlconnect.com/auth/v1/oauth/{provider}/callback, shown read-only in the dashboard.
  • SDKs: @wowsql/sdk 3.10.0 (ProjectAuthClient) for JavaScript and TypeScript; the docs list OAuth methods in all eleven 3.10.0 SDKs, including Python, Swift, Kotlin and Flutter.
  • Plans: Free $0 includes 10,000 monthly active users; Pro $25/month includes 100,000; Scale $99/month includes 2,000,000 (pricing).

How social login works (in 60 seconds)

Every "Sign in with…" button runs the OAuth 2.0 authorization-code flow:

  1. Your app asks the auth service for a provider URL and sends the browser there.
  2. The user signs in at Google, GitHub or Apple and approves the scopes.
  3. The provider redirects to the auth service's callback URL with a one-time code.
  4. The auth service swaps the code for the user's profile (using your client secret, which never touches the browser), creates or finds the user and opens a session.
  5. The auth service redirects to your landing page with the session.

There are two URLs in this flow and mixing them up causes most failures. The callback URL belongs to the auth service and is what you register with the provider. The landing URL belongs to your app and is where the user ends up.

On WoWSQL, step 5 appends access_token, refresh_token, token_type, expires_in, user_id and email to your landing URL's query string. The access token lasts 24 hours and the refresh token 30 days by default.

Before you start

  • A WoWSQL project with Authentication enabled. The free plan is enough.
  • Your project slug (the {slug} in {slug}.wowsqlconnect.com) and the anon key (wowsql_anon_…) from the dashboard.
  • In Auth → URL Configuration, set Frontend URL to your app's URL. If you skip this and pass no landing URL, users land on http://localhost:5000.

Step 1: Set up Google login

  1. Open Google Cloud Console and create (or pick) a project.
  2. Configure the OAuth consent screen: app name, support email and your domain.
  3. Go to Credentials → Create credentials → OAuth client ID, application type Web application.
  4. Under Authorised redirect URIs, paste https://{slug}.wowsqlconnect.com/auth/v1/oauth/google/callback, exactly as the WoWSQL dashboard shows it.
  5. Copy the client ID and client secret.
  6. In WoWSQL, open Auth → Providers → Google, paste both values (no spaces), keep the default scopes openid email profile and click Enable.

WoWSQL requests offline access for Google. While your consent screen is in testing mode, only test users you add can sign in, so publish it before launch.

Step 2: Set up GitHub login

  1. In GitHub, open Settings → Developer settings → OAuth Apps → New OAuth App.
  2. Set the homepage URL to your app and the Authorization callback URL to https://{slug}.wowsqlconnect.com/auth/v1/oauth/github/callback.
  3. Register the app, then generate a client secret.
  4. In WoWSQL, open Auth → Providers → GitHub, paste the ID and secret, keep the default scopes read:user user:email and enable it.

A GitHub OAuth App has one callback URL, so create one app per WoWSQL project (for example, staging and production). Users who hide their email on GitHub still work: WoWSQL reads the primary address from GitHub's /user/emails API with the user:email scope. If none is available, the user gets a placeholder login@github.noreply address and can't receive email from your app.

Step 3: Set up Sign in with Apple

Apple takes the longest because it needs an Apple Developer Program membership and a signed client secret.

  1. In the Apple Developer portal, create an App ID with Sign in with Apple enabled (for a native iOS app) and a Services ID (this is the client ID for web sign-in).
  2. Configure the Services ID: add your domain and set the Return URL to https://{slug}.wowsqlconnect.com/auth/v1/oauth/apple/callback.
  3. Create a Sign in with Apple key and download the .p8 file. Note the Key ID and your Team ID.
  4. Generate the client secret: a JWT signed with that key. Apple caps its lifetime at six months, so put a reminder in your calendar to regenerate it.
  5. In WoWSQL, open Auth → Providers → Apple, paste the Services ID as the client ID and the signed JWT as the client secret, keep the scopes name email and enable it.

Apple returns its response as a form POST, which WoWSQL handles. When the secret expires, click Update and paste a new one; existing sessions stay valid.

If you ship on the App Store: Apple's App Review Guideline 4.8 says apps that use a third-party login such as Google Sign-In for the user's primary account must also offer an equivalent option that limits data collection to name and email, lets users keep their email private and doesn't track them for ads without consent. Sign in with Apple is the usual way to meet it.

Step 4: Add the sign-in buttons (TypeScript)

Install the SDK with npm install @wowsql/sdk. This code follows the TypeScript example in the OAuth docs and uses only methods in the 3.10.0 typings.

// auth.ts
import { ProjectAuthClient } from '@wowsql/sdk'

export const auth = new ProjectAuthClient({
  projectUrl: 'your-project-slug',
  apiKey: 'wowsql_anon_your_key_here', // anon key only; never the service key
})

type Provider = 'google' | 'github' | 'apple'

export async function signInWith(provider: Provider) {
  // Calls GET /auth/v1/oauth/{provider}?frontend_redirect_uri=...
  const { authorizationUrl } = await auth.getOAuthAuthorizationUrl(
    provider,
    'https://yourapp.com/auth/callback', // your landing page, no query string
  )
  window.location.href = authorizationUrl
}
// On https://yourapp.com/auth/callback
import { auth } from './auth'

const params = new URLSearchParams(window.location.search)
const accessToken = params.get('access_token')
const refreshToken = params.get('refresh_token')

if (accessToken) {
  auth.setSession({ accessToken, refreshToken })
  // Remove the tokens from the address bar and browser history right away
  window.history.replaceState({}, '', window.location.pathname)
  const user = await auth.getUser()
  console.log('Signed in as', user.email)
}

Two rules from WoWSQL's security notes: use a landing URL without its own query string (the tokens are appended after a ?), and don't load analytics, third-party scripts or images on the landing page before you clear the URL, so the tokens can't leak through history, logs or the Referer header.

ProjectAuthClient keeps tokens in memory by default. Pass a storage object (it implements getAccessToken, setAccessToken, getRefreshToken and setRefreshToken) if you want the session to survive a reload, and call auth.refreshSession() before the access token expires. auth.logout() ends the session on the server.

Step 5: Query data as the signed-in user

Login matters because your queries then run as that user, and Row Level Security decides what they can see. Send the anon key in apikey and the user's access token in Authorization:

const { accessToken } = auth.getSession()

const res = await fetch('https://your-project-slug.wowsqlconnect.com/rest/v1/notes?select=*', {
  headers: {
    apikey: 'wowsql_anon_your_key_here',
    Authorization: `Bearer ${accessToken}`,
  },
})
const myNotes = await res.json()

With a policy such as using (user_id = auth.uid()) on the notes table, each user only gets their own rows. Why fetch and not WowSQLClient().table()? In 3.10.0, WowSQLClient sends the key you give it as the bearer token, so it queries as the anon role. Our Row Level Security guide shows the policies.

Mobile apps (iOS, Android, Flutter, React Native)

Don't open the provider page in an embedded web view; Google blocks sign-in from them. The docs recommend this pattern:

  1. Get authorization_url from the SDK for your platform (Swift: getOAuthAuthorizationUrl(provider:redirectUri:); Kotlin and Dart have the same method).
  2. Open it in the system browser or an auth session: ASWebAuthenticationSession on iOS, Custom Tabs on Android.
  3. Use an https landing URL that your app handles as a universal link or app link, then read the tokens from that URL.

Our Swift iOS backend guide has a full Swift example.

Account linking and existing users

  • Same email, new provider: if someone signed up with email and password and later uses Google with the same address, WoWSQL signs in that same user and records the provider. Prefer providers that return verified emails, because matching is by email.
  • Linking from a settings page: turn on Allow manual linking (off by default) and call auth.linkOAuthIdentity(provider, { code, redirectUri }). A user holds one linked provider identity at a time, and there is no unlink endpoint. Linking is in the TypeScript, Python and Java SDKs only.
  • Closed sign-ups: with Allow new users to sign up off, OAuth only works for existing users; new accounts get 403 Signups disabled.
  • Two-factor: provider sign-in does not ask for the WoWSQL TOTP code. Rely on the provider's own MFA, or check GET /2fa/status after an OAuth sign-in if you must enforce TOTP.

Common errors and fixes

Error Cause Fix
redirect_uri_mismatch at the provider The registered URL differs from WoWSQL's Paste the dashboard's Redirect URI exactly: https, slug, provider ID, no trailing slash
401 Missing API key Start call sent without apikey Send the anon key; the SDK does this for you
400 OAuth provider google not configured No credentials saved for that provider Save the client ID and secret in Auth → Providers
400 Token exchange failed (...) Wrong client secret, mismatched redirect, or a reused or expired code Re-paste the secret; for Apple, regenerate the JWT
400 No email from OAuth provider The provider returned no email Add the email scope or make the email visible in the provider account
User lands on localhost:5000 No landing URL and no Frontend URL Set Frontend URL or pass the redirect argument
Malformed landing URL Landing URL already had a query string Use a plain path

Errors on the provider callback show as JSON in the user's browser rather than on your landing page, so test each provider end to end before launch. Every sign-in is written to the project audit log as user.oauth_login.

WoWSQL vs Supabase vs Firebase for social login (25 November 2026)

WoWSQL Supabase Auth Firebase Authentication
Social providers 19 working (list above) 19 listed, including Keycloak, plus custom OAuth/OIDC providers Google, Apple, Facebook, Twitter and GitHub in the main SDK list
Custom OIDC / SAML No Custom OAuth/OIDC providers SAML and OIDC with the Identity Platform upgrade
Free monthly users 10,000 MAU 50,000 MAU 50,000 MAU (Spark limited to 3,000 daily users after the Identity Platform upgrade)
Paid step Pro $25/month, 100,000 MAU Pro from $25/month, 100,000 MAU Blaze, pay as you go
Data behind the login Postgres with Row Level Security Postgres with Row Level Security Firestore or Realtime Database with Security Rules

Sources: WoWSQL OAuth docs, WoWSQL pricing, Supabase social login, Supabase pricing, Firebase Auth, Firebase pricing.

Where the others are better: Supabase and Firebase both give five times WoWSQL's free monthly users. Supabase supports custom OIDC providers and a working Keycloak, and Firebase has FirebaseUI, a ready-made login screen, plus enterprise SAML. Both have far longer production track records. Where WoWSQL fits: you want Postgres with RLS, OAuth for all the common providers, TOTP and Turnstile in one flat-priced plan, with your project in Mumbai, US East or Frankfurt.

Related guides

FAQ

How do I add Google login to my app?

Create a Web application OAuth client in Google Cloud Console, add your auth service's callback URL as an authorised redirect URI, and paste the client ID and secret into the auth service. With WoWSQL the callback is https://{slug}.wowsqlconnect.com/auth/v1/oauth/google/callback, and you start sign-in with getOAuthAuthorizationUrl('google', landingUrl).

Can I add social login without a backend server?

Yes. A hosted auth service runs the code exchange and keeps the client secret on its servers. Your frontend only needs the public anon key. WoWSQL, Supabase and Firebase all work this way.

How do I set up GitHub login for a web app?

Create an OAuth App under GitHub Settings → Developer settings, set its Authorization callback URL to your auth service's GitHub callback, and copy the client ID and a new client secret into the auth service. Keep the user:email scope so users with private emails can still sign in.

What do I need for Sign in with Apple?

An Apple Developer Program membership, a Services ID (the client ID for web), a Sign in with Apple key, and a client secret JWT signed with that key. The JWT expires after at most six months, so plan to regenerate it.

Which OAuth providers does WoWSQL support?

On 25 November 2026, 19 providers work: Apple, Azure, Bitbucket, Discord, Facebook, Figma, GitHub, GitLab, Google, Kakao, LinkedIn, Microsoft, Notion, Slack, Spotify, Twitch, Twitter / X, WorkOS and Zoom. Keycloak is listed but not usable yet.

Why do I get redirect_uri_mismatch?

The redirect URL registered at the provider doesn't exactly match the one your auth service sends. Copy the callback URL from the WoWSQL dashboard character for character, including https and the provider ID, with no trailing slash.

Create a free WoWSQL project · OAuth docs · Pricing