Skip to main content

LinkedIn

Creating a custom LinkedIn OAuth application

The step-by-step instructions below follow LinkedIn's documentation on setting up OAuth 2.0 for a web application.

Create credentials for ngrok

  1. Navigate to the LinkedIn Developer Portal, sign in, click My apps on the top menu, and then click Create app.

  2. Enter App name, select a LinkedIn Page, enter the Privacy policy URL in the corresponding fields, and then click Create app.

  3. On the app page, click the Auth tab and make note of both the Client ID and Client Secret values.

  4. Click the pencil icon for the Authorized redirect URLs in the OAuth 2.0 settings section, add the ngrok oauth callback URL (i.e. https://idp.ngrok.com/oauth2/callback), and then click Update.

  5. Click the Products tab, and then 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:
---
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
  1. 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. For example:

# Only allow access to me@example.com. Add this after your OAuth Action.
---
on_http_request:
- expressions:
- "!(actions.ngrok.oauth.identity.email in ['me@example.com'])"
actions:
- type: deny

Additional application setup information