Skip to main content
This guide explains how to create a LinkedIn app and configure ngrok to use LinkedIn OAuth for user authentication. The steps follow LinkedIn’s OAuth 2.0 setup documentation for web applications.

What you’ll need

  • A LinkedIn account and (optionally) a LinkedIn Page for your app.
  • Your ngrok authtoken and an endpoint with the OAuth action in its Traffic Policy.

Create credentials for ngrok

  1. Go to the LinkedIn Developer Portal, sign in, click My apps in the top menu, and then click Create app.
  2. Enter App name, select a LinkedIn Page, enter the Privacy policy URL, and then click Create app.
  3. On the app page, open the Auth tab and note the Client ID and Client Secret values.
  4. In the OAuth 2.0 settings section, click the pencil icon next to Authorized redirect URLs, add https://idp.ngrok.com/oauth2/callback, and then click Update.
  5. Open the Products tab and click Request access for Sign In with LinkedIn using OpenID Connect.

Update your ngrok endpoint Traffic Policy

  1. Access the ngrok Dashboard Endpoints page and locate an existing endpoint you’d like to add this to or create a new one.
  2. In your traffic policy, add the following configuration:
You may add any scopes that are required by your application with the following caveats.
on_http_request:
  - actions:
      - type: oauth
        config:
          provider: linkedin
          client_id: '{your app''s oauth client id}'
          client_secret: '{your app''s oauth client secret}'
          scopes:
            - r_emailaddress
            - r_liteprofile
Click Save to validate and update your traffic policy.

Configure access control

Optionally, configure access control to your service by only allowing specific users or domains.
on_http_request:
  - expressions:
      - '!(actions.ngrok.oauth.identity.email in [''me@example.com''])'
    actions:
      - type: deny

Further resources