Add LinkedIn Open ID Connect (OIDC) as a social connection
You will learn the following:
- Use LinkedIn OIDC to authenticate users with OAuth.
Configure for your development instance
For development instances, Clerk uses preconfigured shared OAuth credentials and redirect URIs — no other configuration is needed.
To configure your development instance, follow these steps:
- In the Clerk Dashboard, navigate to the SSO connections page.
- Select the Add connection button, and select For all users.
- In the Choose provider dropdown, select LinkedIn.
- Select Add connection.
Configure for your production instance
In production instances, you must provide custom credentials, which involves generating your own Client ID and Client Secret using your LinkedIn Developer account.
To configure your production instance, follow these steps:
- On the homepage of the LinkedIn Developer Portal, select Create app. You'll be taken to the Create an app form.
- Fill out the form as follows:
- Under App name, name the application whatever you'd like. "Clerk Demo App", for example.
- Under LinkedIn Page, paste the URL of the LinkedIn page you'd like to associate with the application.
- Under App logo, upload an image to represent the application.
- Under Legal agreement, select the checkbox to agree to LinkedIn's API Terms of Use.
- Finally, select Create app.
Get your Client ID and Client Secret
Once your LinkedIn app is created, you'll be taken to the app's dashboard.
- Select the Auth tab.
- Under Application credentials, you'll find your Client ID and Primary Client Secret. Copy these values and save them somewhere secure, as they are required to connect your LinkedIn app to your Clerk app.
- Keep this page open, as you'll need to come back to it in a moment.
Connect your LinkedIn app and get your redirect URI
- In the Clerk Dashboard, navigate to the SSO connections page.
- Select the Add connection button, and select For all users.
- In the Choose provider dropdown, select LinkedIn.
- Ensure that both Enable for sign-up and sign-in and Use custom credentials are toggled on. Then:
- Under Client ID, add the value you copied from Client ID in the LinkedIn dashboard.
- Under Client Secret, add the value you copied from Primary Client Secret in the LinkedIn dashboard.
- Copy the Redirect URI. You need it to configure your LinkedIn app.
- Select Add connection.
Set the Redirect URI for your LinkedIn application
- Navigate back to the LinkedIn Developer Portal and go to the Auth tab.
- Under the OAuth 2.0 settings section, next to Authorized redirect URLs for your app, select the Edit icon.
- Select Add redirect URL and add the Redirect URI you copied from the Clerk Dashboard.
Enable OpenID Connect in your LinkedIn application
- Select the Products tab.
- Next to Sign In with LinkedIn using OpenID Connect, select Request access.
Test your OAuth
The simplest way to test your OAuth is to visit your Clerk application's Account Portal, which is available for all Clerk applications out-of-the-box.
- In the Clerk Dashboard, navigate to the Account Portal page.
- Next to the Sign-in URL, select Visit. The URL should resemble:
- For development – https://your-domain.accounts.dev/sign-in
- For production – https://accounts.your-domain.com/sign-in
- On the sign-in page, you should see Continue with LinkedIn as an option. Use it to sign in with your LinkedIn account.
Feedback
Last updated on