> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prelude.so/llms.txt
> Use this file to discover all available pages before exploring further.

# LinkedIn

> Configure LinkedIn OAuth for your Auth application.

This guide walks you through configuring LinkedIn as a social login provider for your application.

## Prerequisites

* A [LinkedIn Developer](https://www.linkedin.com/developers/) account
* Your LinkedIn OAuth **Client ID** and **Client Secret**

## Configure LinkedIn OAuth

<Steps>
  <Step title="Create a LinkedIn app">
    1. Go to [LinkedIn Developers](https://www.linkedin.com/developers/apps)
    2. Click **Create app**
    3. Fill in the app details (name, associated LinkedIn Page, logo) and finish the creation flow
    4. Open the **Products** tab and add **Sign In with LinkedIn using OpenID Connect**
    5. Navigate to the **Auth** tab to find your **Client ID** and **Client Secret** — you will need them in the next step

    <Note>
      Scopes (`openid`, `profile`, `email`) are granted by adding the **Sign In with LinkedIn using OpenID Connect** product — they cannot be added manually in the **OAuth 2.0 scopes** panel. Make sure you add the OpenID Connect product and not the legacy "Sign In with LinkedIn" product.
    </Note>
  </Step>

  <Step title="Set the authorized redirect URL">
    In your LinkedIn app's **Auth** tab:

    1. Under **OAuth 2.0 settings > Authorized redirect URLs for your app**, add:

    ```
    https://${YOUR_CUSTOM_DOMAIN}/v1/session/login/oauth/linkedin/callback
    ```

    Replace `${YOUR_CUSTOM_DOMAIN}` with your [custom domain](/session/documentation/domain-names) (e.g. `session.yourapp.com`).

    2. Click **Update**

    <Note>
      The redirect URL must match exactly. Make sure there is no trailing slash and that you are using `https`.
    </Note>
  </Step>

  <Step title="Create the LinkedIn OAuth configuration">
    ```bash theme={null}
    curl -X POST https://api.prelude.dev/v2/session/apps/${APP_ID}/config/login/oauth/linkedin \
      -H "Authorization: Bearer ${MANAGEMENT_API_KEY}" \
      -H "Content-Type: application/json" \
      -d '{
        "client_id": "your-linkedin-client-id",
        "client_secret": "your-linkedin-client-secret",
        "enabled": true,
        "options": {
          "use_email_as_identifier": true,
          "allow_email_account_merge": true
        }
      }'
    ```

    | Field                               | Description                                                                                                     |
    | ----------------------------------- | --------------------------------------------------------------------------------------------------------------- |
    | `client_id`                         | Your LinkedIn OAuth client ID.                                                                                  |
    | `client_secret`                     | Your LinkedIn OAuth client secret.                                                                              |
    | `enabled`                           | Set to `true` to enable LinkedIn login.                                                                         |
    | `options.use_email_as_identifier`   | When `true`, the user's LinkedIn email is stored as an email identifier.                                        |
    | `options.allow_email_account_merge` | When `true`, if a user with the same email already exists, the LinkedIn account is linked to the existing user. |

    <Note>
      LinkedIn uses "Sign In with LinkedIn using OpenID Connect", which requests the `openid`, `profile`, and `email` scopes by default. The email is returned as verified, so it can be used as an identifier and for account merging.
    </Note>
  </Step>
</Steps>

## Update the configuration

To update an existing LinkedIn OAuth configuration:

```bash theme={null}
curl -X PUT https://api.prelude.dev/v2/session/apps/${APP_ID}/config/login/oauth/linkedin \
  -H "Authorization: Bearer ${MANAGEMENT_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your-new-linkedin-client-id",
    "client_secret": "your-new-linkedin-client-secret",
    "enabled": true,
    "options": {
      "use_email_as_identifier": true,
      "allow_email_account_merge": true
    }
  }'
```

## Delete the configuration

To remove LinkedIn OAuth from your application:

```bash theme={null}
curl -X DELETE https://api.prelude.dev/v2/session/apps/${APP_ID}/config/login/oauth/linkedin \
  -H "Authorization: Bearer ${MANAGEMENT_API_KEY}"
```

## What's next?

Now that LinkedIn OAuth is configured on your backend, integrate the frontend using the [Web Integration](/session/documentation/frontend-sdks/web/social-login) guide.
