Access tokens (JWT)
Require a valid bearer token (JWT) on a route. The gateway validates it before the request reaches your API.

Setting it up
Register the identity provider on the Identity providers page.
Open the route editor → Token → Require an access token:
- Provider: the identity provider you registered
- Audiences: the API's application ID URI (e.g.
api://shop); enter multiple if unsure (Entra v1 and v2 tokens carry different forms) - Scopes (optional): every request must have these scopes
- Roles (optional): every request must have one of these app roles
- Required claims (optional): e.g.
tid = <your tenant ID>to prevent tokens from other tenants - Paths without a token (optional): e.g.
/health
It starts in Log only: the request log (view Token) shows what would be refused and why.
Use Test a token: paste a real token to see what it contains and whether it passes.
Switch to Enforce when the log is quiet.
What clients get
- No token or invalid token:
401withWWW-Authenticate: Bearer error="invalid_token" - Valid token but missing required scope/role:
403withinsufficient_scope - Provider keys never read:
503
Clients never get the reason for a 401 or 403 — only the request log shows it.
Passing claims to the backend
Under Claims for the backend, map claim names to header names:
X-User-Id = oid→ addsX-User-Id: <oid value>to the forwarded requestX-User-Email = preferred_username
The gateway always removes these headers from what clients send first, so they cannot be forged.
Tick Remove the token to strip the Authorization header before forwarding.
Per-user rate limiting
A rate limit can count per signed-in user (the token's sub claim) instead of per address. Useful for per-user quotas on an API.
Example: protecting an API with Entra ID tokens
Clients get a token from Entra ID for api://shop. The gateway validates it.
- Register the provider: issuer =
https://login.microsoftonline.com/<tenant>/v2.0, name =entra. - Route editor → Token → Require an access token: provider =
entra, audience =api://shop, required claimtid = <tenant ID>. - Log only for a week. The log is quiet.
- Switch to Enforce.
Requests without a token get 401. Requests with a token for a different tenant get 401 (wrong claim). Requests with a token for the right tenant pass.