LinkedIn sign-in uses OpenID Connect.
1. Create the app
- You need a LinkedIn Company Page to associate the app with.
- Open LinkedIn Developers and click Create app.
- Enter the app name, the company page and a logo, then accept the terms.
- On the Products tab, request Sign In with LinkedIn using OpenID Connect. It is approved immediately.
2. Add redirect URLs
On the Auth tab, under OAuth 2.0 settings, add:
http://localhost:3000/api/auth/callback/linkedinhttps://your-domain.com/api/auth/callback/linkedin
Copy the Client ID and Primary Client Secret from the same tab.
3. Configure the app
NEXT_PUBLIC_AUTH_LINKEDIN=true
AUTH_LINKEDIN_CLIENT_ID="86..."
AUTH_LINKEDIN_CLIENT_SECRET="..."
Set EXPO_PUBLIC_AUTH_LINKEDIN and VITE_AUTH_LINKEDIN too if you use the native apps.
Troubleshooting
unauthorized_scope_error: the OpenID Connect product is not added to the app yet.- Redirect mismatch: the URL must match exactly, and it is built from
NEXT_PUBLIC_URL.
