LinkedIn login is the obvious choice for B2B products: your users already have accounts, the profiles carry real names and work emails, and signup friction drops to a single click. But if you've tried wiring it up on a self-hosted Supabase instance, you've probably hit at least one of the classic failures — unauthorized_scope_error, a provider that claims it "is not enabled" despite your env vars, or a callback that bounces to an error page. Most of these trace back to one fact that's easy to miss: LinkedIn retired its old OAuth product, and Supabase now treats LinkedIn as an OIDC provider with a different name and a different environment variable prefix.
This guide walks through the whole setup on a self-hosted instance: creating the LinkedIn app, configuring GoTrue (the Supabase Auth service), handling redirect URLs, and debugging the errors that trip people up. If you're setting up several providers at once, our OAuth providers overview for self-hosted Supabase covers the shared concepts; here we go deep on LinkedIn specifically, including the quirks documented in Supabase's self-hosted OAuth guide.
Why "LinkedIn OIDC" and Not Just "LinkedIn"
LinkedIn deprecated its legacy OAuth scopes (r_liteprofile, r_emailaddress) in 2023 and replaced them with a product called "Sign In with LinkedIn using OpenID Connect." Apps created since then can only request the OIDC scopes: openid, profile, and email.
Supabase followed suit. GoTrue now ships two LinkedIn providers:
linkedin— the deprecated legacy provider. Dead for new apps. If you use it with a recently created LinkedIn app, LinkedIn rejects the request withunauthorized_scope_error(see the GoTrue issue tracking the migration).linkedin_oidc— the current provider. This is the one you want.
This matters in three places: the env var prefix (LINKEDIN_OIDC, not LINKEDIN), the provider string in your client code ('linkedin_oidc'), and the product you enable in the LinkedIn developer portal. Get any one of them wrong and the flow breaks with an error that doesn't obviously point at the mismatch.
Step 1: Create the LinkedIn App
- Go to the LinkedIn Developer Portal and click Create app.
- Fill in the app name and associate it with a LinkedIn Company Page. This is mandatory — individual accounts can't own apps. If you don't have a company page, create one first (it takes two minutes and doesn't need followers).
- Under the Products tab, request access to Sign In with LinkedIn using OpenID Connect. Approval is instant for this product.
- Under the Auth tab, add your redirect URL:
https://api.yourdomain.com/auth/v1/callback
That URL must point at your Supabase API domain — the one Kong (or your reverse proxy) serves — not your frontend. If your self-hosted instance runs on a custom domain, this is one of the places where having a proper custom domain configured pays off: LinkedIn shows the redirect domain to users during consent, and yourdomain.com reads a lot better than a bare IP or a generic subdomain. The same branding logic applies to Google OAuth consent screens.
- Copy the Client ID and Primary Client Secret from the Auth tab.
Step 2: Configure GoTrue
On Supabase Cloud you'd flip a toggle in the dashboard. Self-hosted, there is no toggle — the Studio dashboard doesn't manage auth providers, so everything goes through environment variables on the auth container.
Add these to your .env (or wherever your compose stack sources variables):
GOTRUE_EXTERNAL_LINKEDIN_OIDC_ENABLED=true GOTRUE_EXTERNAL_LINKEDIN_OIDC_CLIENT_ID=your-client-id GOTRUE_EXTERNAL_LINKEDIN_OIDC_SECRET=your-client-secret GOTRUE_EXTERNAL_LINKEDIN_OIDC_REDIRECT_URI=https://api.yourdomain.com/auth/v1/callback
Two details that cause most of the support threads:
The prefix is LINKEDIN_OIDC, with the underscore. GoTrue maps multi-word provider names directly into the env var. GOTRUE_EXTERNAL_LINKEDIN_CLIENT_ID configures the deprecated provider and silently does nothing for the OIDC one. If you're seeing Unsupported provider: provider is not enabled while staring at env vars you definitely set, check the prefix first.
The variables must actually reach the container. If your docker-compose.yml doesn't pass them through to the auth service, setting them in .env isn't enough. The stock Supabase compose file uses explicit environment: mappings, so a provider that isn't listed there needs to be added:
auth:
environment:
GOTRUE_EXTERNAL_LINKEDIN_OIDC_ENABLED: ${GOTRUE_EXTERNAL_LINKEDIN_OIDC_ENABLED}
GOTRUE_EXTERNAL_LINKEDIN_OIDC_CLIENT_ID: ${GOTRUE_EXTERNAL_LINKEDIN_OIDC_CLIENT_ID}
GOTRUE_EXTERNAL_LINKEDIN_OIDC_SECRET: ${GOTRUE_EXTERNAL_LINKEDIN_OIDC_SECRET}
GOTRUE_EXTERNAL_LINKEDIN_OIDC_REDIRECT_URI: ${GOTRUE_EXTERNAL_LINKEDIN_OIDC_REDIRECT_URI}
Our complete environment variables guide covers how this pass-through pattern works across the whole stack.
Then recreate the auth container:
docker compose up -d auth
Verify Before You Touch the Frontend
Don't debug through your app. Ask GoTrue directly what it thinks is enabled:
curl -s -H "apikey: $ANON_KEY" \ https://api.yourdomain.com/auth/v1/settings | jq '.external.linkedin_oidc'
If that prints true, GoTrue is configured. If it prints false or null, the env vars aren't reaching the container — no amount of frontend work will fix it, so go back to the compose file.
Step 3: Wire Up the Client
The client code is one call, with the provider string matching the OIDC name:
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'linkedin_oidc',
options: {
redirectTo: 'https://app.yourdomain.com/auth/callback',
},
});
The redirectTo is where GoTrue sends the user after the LinkedIn exchange completes — your app, not the API. For it to work, the URL must be allowed in GoTrue's redirect allow-list:
GOTRUE_URI_ALLOW_LIST=https://app.yourdomain.com/auth/callback,https://app.yourdomain.com/**
If the redirect silently falls back to your SITE_URL instead of the page you asked for, the allow-list is the culprit. The interaction between SITE_URL, redirectTo, and the allow-list is subtle enough that we wrote a dedicated guide to redirect URLs and Site URL configuration — it's worth reading if you serve multiple environments from one instance.
Common Errors and What They Actually Mean
unauthorized_scope_error on the LinkedIn consent screen. Your flow is requesting the legacy scopes. Either your client code says 'linkedin' instead of 'linkedin_oidc', or your LinkedIn app doesn't have the OIDC product enabled. Fix both.
"Bummer, something went wrong" from LinkedIn. Redirect URI mismatch. The URL in the LinkedIn Auth tab must match GOTRUE_EXTERNAL_LINKEDIN_OIDC_REDIRECT_URI exactly — scheme, host, path, no trailing slash differences.
Unsupported provider: provider is not enabled. GoTrue never saw your config. Wrong prefix, missing compose pass-through, or the container wasn't recreated after the change.
Signups blocked after a successful LinkedIn consent. If GOTRUE_DISABLE_SIGNUP=true, existing users can log in but new LinkedIn users get rejected after the handshake. Intentional for closed betas; baffling otherwise.
Mobile deep links bounce back to the browser. OAuth on native apps has its own redirect dance — there's an open Supabase discussion about LinkedIn OIDC on Android/iOS, and our deep linking guide for mobile auth covers the self-hosted specifics.
The Honest Trade-Off: Env Vars Don't Scale Across Providers
One provider configured by hand is fine. But the pattern above — portal, credentials, env vars, compose pass-through, container restart, curl to verify — repeats for every provider you add, each with its own naming quirks (LinkedIn's _OIDC suffix, Azure's tenant URL, Apple's generated client secret). On a team, the auth config ends up as tribal knowledge spread across a .env file nobody wants to touch, and a typo takes down login for everyone until someone diffs the variables.
This is one of the gaps Supascale exists to close: it gives self-hosted instances the provider configuration UI that Supabase Cloud has — Google, GitHub, Discord, LinkedIn and the rest configured through a form that writes the correct GoTrue variables and restarts the service for you. No remembering which provider uses a multi-word prefix. It's a one-time license with no per-project fees, so the same setup covers every instance you run.
Wrapping Up
LinkedIn login on self-hosted Supabase comes down to three alignments: the OIDC product on the LinkedIn app, the LINKEDIN_OIDC prefix in your GoTrue environment, and the linkedin_oidc provider string in your client. Verify with the /auth/v1/settings endpoint before debugging anything in the browser, keep your redirect allow-list explicit, and the flow is solid — LinkedIn's OIDC implementation is boring in the best way once the naming is right.
