Skip to main content
This guide refers to using SSO to authenticate access to your endpoints. You cannot use these instructions to set up SSO for logging into your ngrok account in the dashboard.
This guide shows you how to configure Auth0 as the primary Identity Provider for ngrok endpoints using single sign-on (SSO). By integrating Auth0 SSO with ngrok, you can:
  • Restrict access to ngrok endpoints only to users authenticated via Auth0
  • Use Auth0 security policies and multi-factor authentication (MFA) authenticators
  • Use Auth0’s Dashboard to facilitate access to ngrok apps
The ngrok integration with Auth0 supports service provider-initiated (SP-initiated) SSO. In this mode, users access ngrok endpoints and are redirected to Auth0 for authentication.

What you’ll need

  • An Auth0 account with administrative rights to create apps.
  • An ngrok Pay-as-you-go account with an authtoken or admin access to configure endpoints with OpenID Connect.

1. Configure Auth0

In the Auth0 Dashboard, create an application that uses OpenID Connect and supports a client secret (a Regular Web Application). For the full steps, follow Auth0’s Create Applications guide. While configuring the application, set these ngrok-specific values:
  • Allowed Callback URLs: https://idp.ngrok.com/oauth2/callback
  • Application Login URI: the ngrok endpoint URL that exposes your application (for example, https://myexample.ngrok.app).
From the application Settings tab, copy the Domain, Client ID, and Client Secret. You use these values to configure ngrok. Auth0 lets administrators restrict access to the ngrok app through user and group assignments, so make sure the users who need access are assigned to the application before you test.

2. Configure ngrok

Secure your endpoint with the OpenID Connect Traffic Policy action.
This step assumes you have an app running locally (for example, on localhost:3000) with the ngrok agent installed.
Create a policy.yaml file with the following content, replacing the placeholder values with those copied from Auth0:
Start an ngrok endpoint with this policy:
Copy the URL next to Forwarding (for example, https://auth0-sso-test.ngrok.app).

3. Test the integration

  • In your browser, open an incognito window.
  • Access your ngrok endpoint (for example, https://auth0-sso-test.ngrok.app or using the copied endpoint URL).
  • When prompted, log in with your Auth0 credentials.
  • After you log in, you see your web app.