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

# Setting Up LinkedIn OAuth App

> Complete guide to creating and configuring a LinkedIn OAuth application

## Prerequisites

* LinkedIn personal account
* LinkedIn company page (required for app creation with admin access)

## Step 1: Create LinkedIn Developer Account & App

1. Visit [https://developer.linkedin.com/](https://developer.linkedin.com/) and sign in
2. Click **"Create App"** and fill out the form:
   * **App name**: Choose a descriptive name
   * **LinkedIn Page**: Associate with your company page
   * **App logo**: Upload 100x100px PNG (recommended)
   * Accept LinkedIn's API Terms of Use

<img src="https://mintcdn.com/klavisai/WUyJFoTOOKq1g0EB/images/knowledge-base/linkedin_oauth_app/step1.png?fit=max&auto=format&n=WUyJFoTOOKq1g0EB&q=85&s=60b103ed82950036b1183cce88497fe2" alt="LinkedIn App Creation Form" width="1185" height="1243" data-path="images/knowledge-base/linkedin_oauth_app/step1.png" />

## Step 2: Configure OAuth Settings

1. Go to the **"Auth"** tab in your application dashboard
2. Add redirect URLs: `https://api.klavis.ai/oauth/linkedin/callback`

Here is an example of Klavis AI OAuth app configuration:

<img src="https://mintcdn.com/klavisai/WUyJFoTOOKq1g0EB/images/knowledge-base/linkedin_oauth_app/step2.png?fit=max&auto=format&n=WUyJFoTOOKq1g0EB&q=85&s=bc878cce64265c7552418e8a0091872b" alt="OAuth Settings Configuration" width="1209" height="1140" data-path="images/knowledge-base/linkedin_oauth_app/step2.png" />

## Step 3: Request Scopes

<Note>
  Klavis LinkedIn MCP Server uses the following OAuth scopes: `openid,profile,email,w_member_social`
</Note>

1. Go to **"Products"** tab and request **"Shared on LinkedIn"** and **"Sign In with LinkedIn using OpenID Connect"**
2. Once approved, you can see **Client ID** and **Client Secret** from the **"Auth"** tab

Here is an example of Klavis AI OAuth app configuration:

<img src="https://mintcdn.com/klavisai/WUyJFoTOOKq1g0EB/images/knowledge-base/linkedin_oauth_app/step3.png?fit=max&auto=format&n=WUyJFoTOOKq1g0EB&q=85&s=59f018b128a96070539408e4d5814432" alt="Product Access and Credentials" width="818" height="1313" data-path="images/knowledge-base/linkedin_oauth_app/step3.png" />

<Check>
  You have successfully created a LinkedIn OAuth application! You now have your Client ID and Client Secret ready for integration with Klavis AI.
</Check>

## (Optional) Step 4: White Labeling

<Note>
  White labeling allows you to customize the OAuth experience with your own branding instead of Klavis AI's.
</Note>

If you want to use your own LinkedIn OAuth application with custom branding:

1. **Configure White Labeling**: Go to [https://www.klavis.ai/home/white-label](https://www.klavis.ai/home/white-label)
2. **Add Your Credentials**: Enter your LinkedIn **Client ID** and **Client Secret** from Step 3
3. **Set Redirect URI**: Use `https://api.klavis.ai/oauth/linkedin/callback` or your custom callback URL
4. **Initiate OAuth**: Use your client ID when starting the OAuth flow:

   <CodeGroup>
     ```javascript without SDK theme={null}
     // Example: Initiating LinkedIn OAuth with white-label
     const authUrl = `https://api.klavis.ai/oauth/linkedin/authorize?instance_id=${instanceId}&client_id=${yourClientId}`;
     window.location.href = authUrl;
     ```

     ```typescript TypeScript SDK theme={null}
     import { Klavis } from "@klavis/sdk";

     const klavis = new Klavis({
       apiKey: "YOUR_API_KEY"
     });

     // Example: Initiating LinkedIn OAuth with white-label
     const oauthUrl = await klavis.mcpServer.getOAuthUrl({
       serverName: Klavis.McpServerName.Linkedin,
       instanceId: instanceId,
       clientId: yourClientId,
       // redirectUri: YOUR_REDIRECT_URI,
       // scope: "YOUR_SCOPES", 
     });

     window.location.href = oauthUrl;
     ```

     ```python Python SDK theme={null}
     import webbrowser
     from klavis import Klavis
     from klavis.types import McpServerName

     klavis = Klavis(api_key="YOUR_API_KEY")

     # Example: Initiating LinkedIn OAuth with white-label
     oauth_url = klavis.mcp_server.get_oauth_url(
         server_name=McpServerName.LINKEDIN,
         instance_id=instance_id,
         client_id=your_client_id,
         # redirect_uri="YOUR_REDIRECT_URI",
         # scope="YOUR_SCOPES"
     )

     # Open OAuth URL in user's default browser
     webbrowser.open(oauth_url)
     ```
   </CodeGroup>

<Tip>
  For detailed white labeling implementation and code examples, see our [OAuth & White Labeling guide](/auth/white-label).
</Tip>

## Resources

* [LinkedIn OAuth Documentation](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow)
* [Klavis OAuth & White Labeling Guide](/auth/white-label)
* [Klavis White Label Dashboard](https://www.klavis.ai/home/white-label)
