BetterStarter logo
BetterStarter
Docs
GuidesAuth Providers

LinkedIn Auth

Add LinkedIn OAuth sign-in to your app.

Docs are in beta — content is improving rapidly. Found something missing? Open an issue on GitHub or reach out on Twitter (X).

1. Create a LinkedIn App

  1. Go to LinkedIn Developers and click Create App
  2. Fill in the required fields (app name, LinkedIn page, logo)
  3. After creation, go to the Auth tab
  4. Under OAuth 2.0 settings → Authorized redirect URLs for your app, add:
    • http://localhost:3000/api/auth/callback/linkedin (dev)
    • https://yourdomain.com/api/auth/callback/linkedin (prod)
  5. Copy the Client ID and Client Secret from the Auth tab

Add the Sign In with LinkedIn Product

In the Products tab, find and request Sign In with LinkedIn using OpenID Connect. Click Request Access This is required to access the openid, profile, and email scopes.

2. Set Environment Variables

# .env.local
LINKEDIN_CLIENT_ID=your-client-id
LINKEDIN_CLIENT_SECRET=your-client-secret

3. Enable in Config

In src/appConfig.ts set:

linkedin: { enabled: true },

4. Test

  1. Run pnpm dev
  2. Navigate to /auth/sign-in
  3. A Sign in with LinkedIn button will appear

Production Checklist

  • Ensure the Sign In with LinkedIn using OpenID Connect product is approved (usually instant)
  • Add your production redirect URL to the app's authorized redirect URLs

Troubleshooting

  • No email returned — LinkedIn's email claim is optional and may be absent for members without a confirmed email address
  • invalid_scope — make sure the Sign In with LinkedIn using OpenID Connect product is added to your app
  • No LinkedIn button — check LINKEDIN_CLIENT_ID and LINKEDIN_CLIENT_SECRET are set and linkedin.enabled is true

On this page