Terminating user identity at the mesh edge
The Mesh Series · Article 11
Microsoft Entra IDJWT validationOAuth 2.0 & OIDCAuthorizationPolicy.NET & C#IstiomTLS

The Mesh Series · Article 11 · Where Entra meets Istio
Article 10 named the seam: the ingress gateway is where the user plane terminates and the workload plane takes over. This article builds it. And it opens on a distinction most tutorials skip, because getting it wrong is how "we have auth at the edge" turns into a finding.
The mesh edge does one job, precisely: it rejects any request that doesn't carry a valid Entra token before that request touches a service. That's it. It checks the token; it does not hand one out. RequestAuthentication is a bouncer, not a box office — it inspects the ID at the door, it doesn't sell the ticket. Confuse the two and you'll wire up token validation, watch anonymous traffic sail straight through, and never understand why until an auditor does.

One chokepoint. A request arrives, the gateway validates the Entra JWT — issuer, audience, signature, expiry — and either the request continues inward carrying a verified user principal, or it dies at the door with a 401 or a 403. Nothing unauthenticated gets past. That single property is the whole reason to terminate identity at the edge instead of leaving it to each service.
Why regulated enterprises should care
The value of a chokepoint is that it lets you prove a negative.
Ask any auditor's real question: can an unauthenticated request reach a service that touches regulated data? If every service validates its own tokens, the honest answer is "we believe not, across all of them, if none of them has a bug or a missed annotation." That's not a proof. That's a hope distributed across every team. Under CERT-In's incident regime in India or a SAMA maturity assessment in the Gulf, "we think all our services check" is precisely the kind of claim that turns into a finding when one service didn't.
Terminate identity at the edge and the claim changes shape. There is one place all inbound traffic passes through, one policy that rejects anything without a valid principal, and one configuration to show. "No unauthenticated request reaches a workload, and here is the single gateway policy that guarantees it" is a sentence you can defend. The edge doesn't just add security; it makes the security checkable, which for a regulated institution is the point that actually matters.
There's a second reason, quieter but real. The token you're validating is a bearer credential — whoever holds it is the user. Validating it once, at a hardened edge you control, and then transporting it inward over the workload plane's mTLS (Article 10) is far safer than accepting raw user tokens deep in your service graph where a compromised internal service could replay one. The edge is where the bearer token stops being the transport and starts being context.
How the pieces come together
Three objects, and one gotcha that has bitten everyone at least once.
First, a Gateway — the Kubernetes Gateway API is the model Istio steers you toward now, and it's where inbound traffic lands. Second, a RequestAuthentication attached to that gateway, teaching it to validate Entra v2 tokens. Third — and this is the gotcha — an AuthorizationPolicy, because RequestAuthentication by itself rejects nothing. On its own it validates any token present and cheerfully lets tokenless requests through. It only produces a principal when a valid token exists; it never produces a denial. The denial is a separate object.
So the pattern is always a pair: RequestAuthentication to define what a valid token looks like, and an AuthorizationPolicy to say and you must have one. Miss the second object and you've built a bouncer who checks IDs and then waves everyone in regardless. This is not a hypothetical failure mode. Configure it exactly this way — validation on, nothing enforcing it — and the party who spots the open door is often your own infosec team, flagging the gateway for allowing open access while the token validation sits there working perfectly and stopping no one.
One more honest point. All of this validates a token the client already has. A browser user arriving cold has no token, and the mesh cannot run the OIDC login dance — no redirect to Entra, no code exchange, no session cookie. For that you put oauth2-proxy in front, wired to the gateway through an external-authorization hook. It runs the interactive flow and hands the validated identity onward. The mesh checks IDs; oauth2-proxy is the box office. Keep them straight and the architecture stays clean.
Show the config
The Gateway, then the validate-and-reject pair. Entra v2 issuer and JWKS, audience pinned to your API — and the object that actually closes the door:

Two objects, and the behaviour is now exact: a valid token passes (200), an invalid token is rejected by validation (401), and a missing token is rejected by policy (403). That 401-versus-403 split is worth internalising — it tells you, from the status code alone, whether a caller sent a bad token or no token at all.
For interactive users, the login flow is oauth2-proxy behind a CUSTOM authorization policy that delegates the decision to it:

And the 2026 detail worth calling out: oauth2-proxy authenticates itself to Entra with no client secret. It uses its projected Kubernetes service-account token as a federated client assertion — the exact workload-identity mechanism from Article 8. The component doing your user login holds no secret of its own. The whole edge, human flow included, stays passwordless.
Your service behind the gateway barely participates. The identity has already been established and transported inward; the app reads it:
// the edge already validated the token and rejected everyone without onevar user = User.FindFirst("oid")?.Value; // the human, established at the edge
Security · Audit · Integration
Security property gained. A single, hardened rejection point. No unauthenticated request reaches any workload, and the bearer token is validated once at a boundary you control rather than trusted repeatedly deep in the graph. The attack surface for "smuggle an anonymous request to a service" collapses to one policy.
Audit evidence produced. You can show the auditor one Gateway, one RequestAuthentication, one AuthorizationPolicy, and say: every inbound request is checked here, and anything without a valid Entra principal is rejected with a logged 401 or 403. That's a provable boundary, not a distributed hope — exactly the shape CERT-In and SAMA reward.
How it integrates. The edge establishes the user principal; the workload plane (Article 10, mTLS) transports it inward; Article 12 validates that same token again inside the service, deeply. That isn't redundancy for its own sake — it's the defense-in-depth Article 13 argues for. The edge is the first line. It is not the only one.
Alternatives, and when you'd actually pick them
The Istio-gateway-terminates-identity pattern is the default when you already run the mesh. The variations are about who runs the login and how much gateway you want.
oauth2-proxy at the edge (interactive users). Not really an alternative — a necessary companion whenever real humans with browsers sign in, because the mesh validates tokens but doesn't issue them. Reach for it the moment you have a browser-based front end; skip it when every client is a service or a SPA that already completes the OIDC flow itself and arrives with a bearer token.
Azure API Management in front. When the edge needs to be a product — quotas, rate limits, subscription keys, developer portal, monetised APIs — APIM is the managed front door and can validate Entra tokens before traffic ever reaches your gateway. The cost is another hop and another bill; the benefit is API-product features the mesh has no opinion about. Pick it when you're selling or governing APIs, not just securing them.
Validate only in the app, no edge enforcement. Skip the gateway policy and let each service check its own token with Microsoft.Identity.Web. Legitimate for a single service, or before you've adopted a mesh. But you've given up the provable boundary — you can no longer point to one place and prove nothing anonymous gets through. That deep in-code validation still matters; it's Article 12. It just shouldn't be the only line.
From the toy to the standard
The toy is one Gateway and a validate-and-reject pair on a single namespace. The industry-standard version is the same shape at the front of everything: one hardened ingress, every inbound request checked against Entra there, tokenless and bad-token traffic rejected with logged status codes, interactive login handled by a secretless oauth2-proxy, and the established identity carried inward as context over mTLS. One boundary, provable, passwordless end to end.
But a token that passes the edge is not a token you've fully trusted. The gateway checked issuer, audience, signature, expiry — the essentials. Inside the service there are claims to enforce, key rotation to survive, and audiences to pin exactly, and the service should not assume the edge did all of that perfectly. Validating the Entra JWT properly, in C# is the next article — the in-code half of the defense the edge began.
That's Article 12: validating Entra JWTs in your C# service.
Next in the series — Article 12: Validating Entra JWTs in C#.
Key skills & topics in this article
Microsoft Entra IDJWT validationOAuth 2.0 & OIDCAuthorizationPolicy.NET & C#IstiomTLS
Also on LinkedIn.