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

# LinkedIn

> How to add LinkedIn to your system

<Snippet file="never-share.mdx" />

<Steps>
  <Step title="Create a new app">
    Head over to [LinkedIn developers](https://www.linkedin.com/developers/apps) and create a new app.

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/linkedin/linkedin-001.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=16897bbb984f26f014317375c2efd1f0" alt="LinkedIn" width="2366" height="676" data-path="images/providers/linkedin/linkedin-001.png" />
  </Step>

  <Step title="Add required products">
    Fill in all the details, once created head over to Products and make sure you add all the required products:

    * Share on LinkedIn
    * Advertising API
    * Sign In with LinkedIn using OpenID Connect

          <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/linkedin/linkedin-002.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=d61fd603ae5411068cebb08ebf37700e" alt="LinkedIn" width="2436" height="1356" data-path="images/providers/linkedin/linkedin-002.png" />

    <Warning>
      It is important to request the Advertising API permissions and fill up the request form, or you will not have the ability to refresh your tokens.
    </Warning>
  </Step>

  <Step title="Check the granted scopes">
    Under the Auth tab of your app, the "OAuth 2.0 scopes" section must list all of the scopes Postiz requests:

    * `openid`
    * `profile`
    * `w_member_social`
    * `r_basicprofile`
    * `rw_organization_admin`
    * `w_organization_social`
    * `r_organization_social`

    The last four come from the Advertising API product, `w_member_social` from Share on LinkedIn, and `openid` / `profile` from Sign In with LinkedIn using OpenID Connect.

    <Note>
      The organization scopes are required for the regular LinkedIn provider too, not only for LinkedIn Page. Both providers use the same app and the same scope set.
    </Note>

    <Warning>
      If a scope is missing, LinkedIn does not fail the login. It issues a token without that scope, and Postiz rejects the connection with a `NotEnoughScopes` error. If you get that error, this Auth tab list is the first place to check.
    </Warning>
  </Step>

  <Step title="Configure OAuth2 Redirect URI">
    <Snippet file="oauth2redirect.mdx" />

    **Your LinkedIn OAuth2 Redirect URI:**

    * Production: `https://your-postiz-domain.com/integrations/social/linkedin`
    * Local development: `http://localhost:4200/integrations/social/linkedin`
    * Docker: `http://localhost:5000/integrations/social/linkedin`

    <Note>
      If you are using the "LinkedIn Page" provider, replace `linkedin` with `linkedin-page` in the redirect URI.
    </Note>
  </Step>

  <Step title="Copy your credentials">
    Copy the created `Client ID` and `Client Secret` and add them to your `.env` file.

    ```env theme={null}
    LINKEDIN_CLIENT_ID=""
    LINKEDIN_CLIENT_SECRET=""
    ```

    You can find those under the Auth Tab of your LinkedIn App in the developer portal.
  </Step>
</Steps>
