Add OAuth with Traffic Policy
The quickest way to protect your endpoint is with the OAuth Traffic Policy action. Add the following to your Traffic Policy configuration to require Google authentication:Using a Managed Provider
The following Traffic Policy configuration will provide your app with a google authentication step.provider value can be replaced with any of the Supported Providers that have an
a managed app available.
This example uses a managed Google OAuth application owned by ngrok.
This is useful for testing and development, but you should use your own OAuth application when moving to production.
See the OAuth action documentation for details.
Supported authentication methods
| Method | Description |
|---|---|
| OAuth | Require login via Google, GitHub, Microsoft, and other providers |
| OpenID Connect | Integrate with any OIDC-compliant identity provider |
| SAML | Use SAML-based SSO for enterprise authentication |
| Basic Auth | Require a username and password |
Restrict access to specific users
You can restrict access to specific email addresses by defining your Traffic Policy in your ngrok configuration file:ngrok.yml
Next steps
- OAuth action reference: full configuration options for OAuth
- Network security: combine auth with IP restrictions and other controls
- Traffic Policy: explore all available Traffic Policy actions