Akamai EdgeWorkers — Ory token validation
Community-contributed integration
This integration is community-maintained — see cloudflare-workers for the canonical reference implementation. Reference: ory/integrates/edge-token-validation/akamai-edgeworkers.
Akamai EdgeWorkers is a V8-isolate serverless runtime. You can validate Ory Network session tokens and JWTs at the Akamai edge using the same pattern as Cloudflare Workers.
How it differs from the Cloudflare reference
- There is no
fetch()global. Use the EdgeWorkershttpRequestAPI. - Use EdgeKV for cross-edge cache. It falls back to a per-isolate
Mapwhen not provisioned. - The CPU budget is stricter (~50ms wall-clock). JWKS verification fits comfortably, but
whoamicalls eat into the budget. - Akamai Property Manager wires the EdgeWorker to a request behavior on the relevant hostname or path.
How it works
- The EdgeWorker fires on
onClientRequest. - It reads the session cookie or
Authorization: Bearerheader. - For JWTs, it verifies the signature against the cached Ory JWKS via the Crypto API.
- For session cookies, it calls Ory's
/sessions/whoamiviahttpRequestand caches the result for 30–60s in EdgeKV. - When the token is valid, it injects the
X-User-Idheader. When it's invalid, it returns a 401 from the edge.
