This guide describes how to configure individual user authentication and authorization for applications running behind a Datum gateway usingDocumentation Index
Fetch the complete documentation index at: https://datum-4926dda5-how-to-guides-gateway-auth.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
datumctl. Auth0 handles Google social login and enforces an email-based allow-list — unauthorized users are blocked before a token is ever issued. The configuration uses Envoy Gateway SecurityPolicy resources and applies to Windows, macOS, and Linux.
How It Works
Authorization (are you allowed): Auth0 checks the user against your allow-list before issuing a token. Unauthorized users never get a token — Envoy never sees them.
Prerequisites
datumctlinstalled and authenticated- A valid Datum Project
- An existing HTTPProxy in the Datum UI (this provides the Gateway and HTTPRoute automatically)
- An Auth0 account (free tier is sufficient)
- A Google Cloud project for the social connection
Note: The HTTPProxy name is the name of the auto-generated HTTPRoute that the SecurityPolicy will target. Find it with:
Part 1: Auth0 Setup
Step 1: Create an Auth0 Tenant
- Sign up at auth0.com and create a tenant
- Note your tenant domain — it looks like
dev-xxxxxxxx.us.auth0.com
Step 2: Create an Application
- In the Auth0 dashboard go to Applications → Applications → Create Application
- Name it (e.g.,
datum-gateway-app) - Select Regular Web Applications
- Click Create
- On the Settings tab, note your Client ID and Client Secret
- Under Allowed Callback URLs add:
- Under Allowed Logout URLs add:
- Click Save Changes
Step 3: Enable Google Social Login
- Go to Authentication → Social → Create Connection
- Select Google / Gmail
- Enter your Google OAuth Client ID and Client Secret (from Google Cloud Console → APIs & Services → Credentials)
- Enable the connection for your application under the Applications tab of the connection
- In Google Cloud Console, add Auth0’s callback URL to your OAuth client’s Authorized redirect URIs:
This is required so Google can redirect back to Auth0 after login. Without it, Google returns
Error 400: redirect_uri_mismatch.
Note: If you do not have Google OAuth credentials yet, Auth0 provides a built-in dev key for testing. Go to the Google connection settings and leave Client ID/Secret blank — Auth0 will use its own dev credentials. Create dedicated Google OAuth credentials before moving to production.
Step 4: Create an Access Control Action
This is where individual user access is enforced. Auth0 runs this code during login — users not in the list are denied before a token is ever issued.- Go to Actions → Library → Build Custom
- Name it
enforce-email-allowlist - Select Login / Post Login trigger
- Replace the default code with:
- Click Deploy
- Go to Actions → Triggers → post-login
- Drag your
enforce-email-allowlistaction from the right sidebar into the flow between Start and Complete - Click Apply
allowedEmails array and click Deploy. No gateway config changes required.
Part 2: Datum Gateway Configuration
The Datum HTTPProxy already manages the Gateway and HTTPRoute. You only need to create a Secret (to store the Auth0 client secret) and a SecurityPolicy (to attach OIDC to the route).Step 1: Set Variables
Windows (PowerShell)
macOS / Linux
Step 2: Create the Auth0 Client Secret
The Secret must include thegateway-sync label or the edge proxy will not receive it and all requests will return HTTP 500.
Windows (PowerShell)
macOS / Linux
Step 3: Apply the SecurityPolicy
This attaches OIDC authentication to the existing HTTPProxy route.Warning: Use only theoidcblock — do not add ajwtblock, as it conflicts with the OIDC filter and causes HTTP 500.
Windows (PowerShell)
macOS / Linux
Verification
Unauthenticated Request — Redirects to Auth0
Browser Flow — Allowed User
- Open
https://your-app.example.comin a browser - You are redirected to Auth0 → Google login
- Sign in with an email in the allow-list
- You are redirected back and the app loads —
HTTP 200
Browser Flow — Denied User
- Sign in with an email not in the allow-list
- Auth0 displays:
Access denied: you are not authorized to use this application. - No token is issued — Envoy is never reached
Managing Access
All access control is managed in the Auth0 dashboard — no gateway config changes needed. Add a user:- Go to Actions → Library →
enforce-email-allowlist - Add the email to
allowedEmails - Click Deploy
- Remove the email from
allowedEmails - Click Deploy
- Optionally revoke any active sessions: User Management → find user → Invalidate Sessions
Cleanup
Windows (PowerShell)
macOS / Linux
Troubleshooting
| Symptom | Root Cause | Resolution |
|---|---|---|
| HTTP 200 instead of redirect | SecurityPolicy not yet propagated | Wait 60 seconds; verify with datumctl get securitypolicy |
| HTTP 500 on all requests (immediate) | jwt block present in SecurityPolicy | Remove jwt block — use oidc block only |
| HTTP 500 on all requests (immediate) | WAF (TrafficProtectionPolicy) blocking OIDC | Remove the TrafficProtectionPolicy targeting the Gateway |
| HTTP 500 on all requests | Secret missing gateway-sync label | Verify label is present; re-apply Secret if needed |
Auth0 error: callback URL mismatch | App hostname not in Auth0 Allowed Callback URLs | Add https://<hostname>/oauth2/callback in Auth0 Application Settings |
Google error 400: redirect_uri_mismatch | Auth0 callback not in Google OAuth client | Add https://<auth0Domain>/login/callback to Google Cloud Console Authorized redirect URIs |
| Redirect loop | redirectURL mismatch | Ensure it matches Allowed Callback URLs in Auth0 exactly |
| User sees “Access denied” at Auth0 | Not in allow-list | Add email to the Action and redeploy |
| User bypasses allow-list | Action not in Login flow | Verify action is added under Actions → Triggers → post-login |
Useful Debug Commands
Summary
| Concern | Where it lives |
|---|---|
| Google social login | Auth0 social connection |
| Who is allowed | Auth0 Action (enforce-email-allowlist) |
| Token issuance | Auth0 — denied users never get a token |
| Token validation | Envoy OIDC block (handled automatically) |
| Session management | Envoy OIDC block (cookie) |
| App changes required | None |