AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Linkedin_oidc Provider Uses Api.Linkedin.Com For The Authorization Redirect Instead Of Www.Linkedin.Com

The LinkedIn OIDC provider builds its OAuth authorization and token URLs against api.linkedin.com instead of LinkedIn's documented www.linkedin.com endpoint, causing users with an active linkedin.com session to be forced to log in again on every sign-in attempt.

highConfidence 90%Supabase

Origin Analysis

In internal/api/provider/linkedin_oidc.go, the constant defaultLinkedinOIDCAPIBase is set to "api.linkedin.com". This host is LinkedIn's REST API host, not the interactive OAuth authorization host, and it does not share session cookies with www.linkedin.com. Consequently, when the provider constructs AuthURL and TokenURL using this base, the authorization request redirects to a domain that cannot recognize the user's existing LinkedIn session, forcing a full login.
1. Enable LinkedIn (OIDC) provider in a Supabase project with valid LinkedIn app credentials. 2. From a browser that already has an active linkedin.com session, call supabase.auth.signInWithOAuth({ provider: "linkedin_oidc" }). 3. Observe the network redirect chain: it goes to api.linkedin.com/oauth/v2/authorization, then to www.linkedin.com/uas/login?session_redirect=... with a full username/password prompt. 4. Compare with a direct authorization request to www.linkedin.com/oauth/v2/authorization, which shows the expected "Continue as [Name]" consent screen.

Fixing Code Block

Edge Case Audit

Self-hosted deployments that provide a custom external URL via extension will not be affected. After deploying this change, verify that token exchange succeeds against www.linkedin.com/oauth/v2/accessToken. If any enterprise LinkedIn application still relies on api.linkedin.com for the token endpoint, roll back only the TokenURL change while keeping AuthURL on www.linkedin.com. Test in a staging environment before production rollout. To roll back, revert the two constant values to api.linkedin.com.

Ecosystem Topology