Skip to main content
This guide shows you how to create a GitLab application and configure ngrok to use GitLab OAuth for user authentication. The steps below follow GitLab’s OAuth 2.0 setup documentation for web applications.

What you’ll need

  • A GitLab account.
  • Your ngrok authtoken and an endpoint with the OAuth action in its Traffic Policy.

Create an application

Follow GitLab’s OAuth application documentation to add a new application, and set the following:
  • Redirect URI: https://idp.ngrok.com/oauth2/callback
  • Scopes: select the scopes appropriate for your app, such as openid, profile, and email.
After saving, note the Application ID and Secret for use in your Traffic Policy below.
Restricting sign-in: To limit which users can sign in with GitLab, create the application under one of your groups or as an instance-wide application rather than as a user-owned application. See Further resources for more detail.

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.
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.

Further resources