1. Set up your OIDC provider
You can use any provider with theoidc Traffic Policy action.
You’ll need the base URL of your Open ID provider, and, in most cases, a client ID and secret.
We’ll refer to these as $ISSUER_URL, $CLIENT_ID, and $CLIENT_SECRET.
2. Start endpoints for your services
Start an internal Agent Endpoint, replacing$PORT based on where one of your upstream services listen.
You can also use one of our SDKs or the Kubernetes Operator.
$OTHER_PORT with the port for this service.
3. Reserve a domain
Navigate to the Domains section of the ngrok dashboard and click New + to reserve a free static domain likehttps://your-service.ngrok.app or a custom domain you already own.
We’ll refer to this domain as $NGROK_DOMAIN from here on out.
4. Create a Cloud Endpoint
Navigate to the Endpoints section of the ngrok dashboard, then click New + and Cloud Endpoint. In the URL field, enter the domain you just reserved to finish creating your Cloud Endpoint.5. Enforce OIDC authentication and routing with Traffic Policy
While viewing your new cloud endpoint in the dashboard, copy the policy below and paste it into the Traffic Policy editor, replacing$ISSUER_URL, $CLIENT_ID, and $CLIENT_SECRET with the appropriate values.
6. Try out your endpoints
Visit the domain you reserved either in the browser or in the terminal using a tool likecurl.
You should see the app or service at the port connected to your internal Agent Endpoint.
What’s next?
- Read our guides on securing access to remote devices or site-to-site connectivity for more comprehensive setups involving Service Users, scoped auth tokens, and mTLS.
- Explore other examples of using the
openid-connectTraffic Policy action. - View your traffic in Traffic Inspector.