linkedin_oidc provider uses api.linkedin.com for the authorization redirect instead of www.linkedin.com
Title: linkedin_oidc provider uses api.linkedin.com for the authorization redirect instead of LinkedIn's documented www.linkedin.com, breaking session recognition and forcing password re-entry on every sign-in
Body:
Summary
The linkedin_oidc OAuth provider builds its authorization URL against https://api.linkedin.com/oauth/v2/authorization. LinkedIn's own developer documentation specifies the interactive authorization endpoint as https://www.linkedin.com/oauth/v2/authorization. As a result, users with an active, valid linkedin.com browser session are not recognized when authorizing through Supabase, and LinkedIn falls back to a full username/password login screen (/uas/login) on every single sign-in attempt — even immediately after a successful one. Sites that call LinkedIn's documented www.linkedin.com endpoint directly do not have this problem; they get LinkedIn's normal "Continue as [Name]" session-based consent screen.
Environment Provider: linkedin_oidc ("LinkedIn (OIDC)" in the Supabase Dashboard) Client library: supabase-js signInWithOAuth({ provider: "linkedin_oidc" }) Hosted Supabase project (not self-hosted) Steps to reproduce Enable the LinkedIn (OIDC) provider in a Supabase project with a valid LinkedIn app (Client ID/Secret). Call supabase.auth.signInWithOAuth({ provider: "linkedin_oidc", options: { redirectTo } }) from a browser that already has an active linkedin.com session (i.e., the user is logged into linkedin.com in that same browser). Observe the resulting redirect chain in the browser's Network tab. Actual behavior
The request chain is:
https://.supabase.co/auth/v1/authorize?provider=linkedin_oidc&...&code_challenge_method=s256 → https://api.linkedin.com/oauth/v2/authorization?client_id=...&redirect_uri=https://.supabase.co/auth/v1/callback&response_type=code&scope=openid+email+profile&state=... → https://www.linkedin.com/uas/login?session_redirect=... ← forces full login/password screen, every time Expected behavior
Per LinkedIn's documentation, the authorization request should go to https://www.linkedin.com/oauth/v2/authorization. When it does (verified against a separate, unrelated third-party app in the same browser, at the same time, with the same LinkedIn session), LinkedIn correctly recognizes the existing session and presents its normal "Continue as [Name]" consent screen — no password re-entry.
Root cause
In internal/api/provider/linkedin_oidc.go:
go const ( defaultLinkedinOIDCAPIBase = "api.linkedin.com" IssuerLinkedin = "https://www.linkedin.com/oauth" ) ... apiPath := chooseHost(ext.URL, defaultLinkedinOIDCAPIBase) ... Endpoint: oauth2.Endpoint{ AuthURL: apiPath + "/oauth/v2/authorization", TokenURL: apiPath + "/oauth/v2/accessToken", },
api.linkedin.com is LinkedIn's REST API host (used for calls like api.linkedin.com/v2/me after a token is issued), not the documented interactive OAuth authorization host. The IssuerLinkedin constant in the same file already correctly uses www.linkedin.com for OIDC token/issuer validation — only the interactive AuthURL (and TokenURL) default is wrong. The same incorrect default also exists in the legacy internal/api/provider/linkedin.go provider (defaultLinkedinAPIBase = "api.linkedin.com").
Suggested fix
Change defaultLinkedinOIDCAPIBase (and the legacy defaultLinkedinAPIBase) to www.linkedin.com, matching LinkedIn's documented authorization endpoint (https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow) and the IssuerLinkedin constant already used elsewhere in the same file.
Impact
Every hosted Supabase project using the built-in LinkedIn (OIDC) provider forces users to re-enter their LinkedIn password on every sign-in, with no session persistence — regardless of whether the user is already logged into linkedin.com. There is currently no dashboard setting or documented override to correct the host from the client side.
Source: supabase/supabase