Supported providers
The 22 OAuth providers GoTrue ships with on Powabase:apple · azure · bitbucket · discord · facebook · figma · github · gitlab · google · kakao · keycloak · linkedin_oidc · notion · slack · slack_oidc · spotify · twitch · twitter · workos · zoom
All of them are off by default. You enable them with provider-specific environment variables (Helm overrides for self-hosted, or the Studio’s auth settings for managed). The pattern for any provider is:
azure, gitlab, keycloak, workos) also need a url field for their issuer endpoint — useful when the provider is self-hosted or you’re using a non-default tenant.
The redirect flow at a glance
- Your app calls
GET /auth/v1/authorize?provider=google&redirect_to=<your-callback>. - GoTrue 302-redirects the browser to Google’s consent screen with the client_id, scopes, and a state parameter it generated.
- The user authorizes; Google redirects back to GoTrue’s callback URL (
<project>/auth/v1/callback) with an authorization code. - GoTrue exchanges the code with Google for the user’s profile, creates/updates the user record, and 302-redirects the browser to your
redirect_toURL with a session code in the URL fragment. - Your callback page extracts the tokens from the URL fragment (or, in PKCE mode, exchanges the code for tokens) and persists them.
Setting up Google
Three pieces: register a Google Cloud OAuth client, configure GoTrue, write the app code.1. Google Cloud setup
In the Google Cloud Console, create an OAuth 2.0 Client ID. The fields that matter:- Application type: Web application.
- Authorized JavaScript origins: the origin of your app (e.g.,
https://your-app.example.com). - Authorized redirect URIs:
https://{ref}.p.powabase.ai/auth/v1/callback. This is GoTrue’s callback, not your app’s. Google will call GoTrue, GoTrue will call your app.
2. Enable in Powabase
For managed cloud, setGoogle Client ID and Google Client Secret in the Studio’s Authentication settings. For self-hosted:
3. App code
Setting up GitHub
Same shape, different provider console.1. GitHub OAuth app setup
In GitHub Developer Settings, create a new OAuth App:- Homepage URL: your app’s URL.
- Authorization callback URL:
https://{ref}.p.powabase.ai/auth/v1/callback. GoTrue’s callback, not your app’s.
2. Enable in Powabase
3. App code
Same as Google, just changeprovider=google to provider=github:
Requesting additional scopes
By default, GoTrue requests the minimum scopes needed to identify the user (typically email + profile). To request more — e.g., to read a GitHub user’s repos or send email through Gmail — passscopes as a query parameter:
app_metadata.provider_token on the user record. Read it from auth.jwt() -> 'app_metadata' ->> 'provider_token' in SQL, or from the user object in your client SDK.
GoTrue does not refresh provider tokens for you. If you need long-lived API access to the upstream provider, you’ll need to handle the refresh against that provider’s token endpoint yourself.
PKCE — when and why
For public clients (browser SPAs, mobile apps), the standard OAuth flow has a vulnerability: the authorization code is transmitted via URL parameters back to your app, and any local code that intercepts that URL can exchange the code for tokens. PKCE (Proof Key for Code Exchange) fixes this by having your client generate a one-time secret at the start of the flow and prove possession of it during the code exchange — an intercepted code is useless without the secret. GoTrue supports PKCE automatically when you pass acode_challenge parameter to /auth/v1/authorize. Most client SDKs (e.g., supabase-js) handle PKCE transparently. If you’re rolling your own client:
The redirect-allow-list gotcha
Thegotrue.uriAllowList is a comma-separated list of URLs GoTrue will redirect to. If your redirect_to isn’t in the list, GoTrue silently drops it and redirects to gotrue.siteUrl instead — which on a fresh project is unset, so you end up on the GoTrue host with no obvious error.
Set the allow list to include every callback URL your app might use:
Common failure modes
- “redirect_uri_mismatch” from the provider. The callback URL you registered with Google/GitHub doesn’t match
https://{ref}.p.powabase.ai/auth/v1/callback. Update the provider’s callback URL. - Redirect lands on GoTrue host, not your app. Your
redirect_toisn’t in theuriAllowList. Add it. error=server_errorwith no detail. GoTrue couldn’t exchange the code with the provider. Most often: the provider’s client secret is wrong in your Helm config, or the provider has rate-limited your client ID. Check the GoTrue pod logs.- User signs in but lands without
app_metadata.provider_token. Some providers need explicit scopes to return their token (e.g., Google’soffline_access). Passscopes=offline_accessin the/authorizequery.
Next steps
Signup, signin, magic link
Email/password and magic-link flows as the alternative to OAuth.
Auth model
What’s inside the JWTs you get back from these flows.
Auth Reference
Full /auth/v1/* endpoint surface, including the OAuth-specific endpoints.
RLS Cookbook
How to use OAuth-provided claims (provider, provider_id) in RLS policies.