--traffic-policy-file flag:
Create a file called oauth-policy.yml:
--oauth-allow flags.
To restrict access by domain, use an expression to check the email domain after the OAuth action:
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Learn how to secure your ngrok endpoints with OAuth 2.0.
--traffic-policy-file flag:
Create a file called oauth-policy.yml:
on_http_request:
- actions:
- type: oauth
config:
provider: github
ngrok http 80 --traffic-policy-file=oauth-policy.yml
--oauth-allow flags.
To restrict access by domain, use an expression to check the email domain after the OAuth action:
on_http_request:
- actions:
- type: oauth
config:
provider: google
- expressions:
- "!(actions.ngrok.oauth.identity.email.endsWith('@acme.com') || actions.ngrok.oauth.identity.email.endsWith('@doe.com'))"
actions:
- type: deny
ngrok http 8080 --traffic-policy-file=oauth-policy.yml
on_http_request:
- actions:
- type: oauth
config:
provider: google
- expressions:
- "!(actions.ngrok.oauth.identity.email in ['john@acme.com', 'jane@doe.com'])"
actions:
- type: deny
ngrok http 8080 --traffic-policy-file=oauth-policy.yml
Was this page helpful?