AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Edge Functions JWT Verification Rejects Valid ES256 Tokens (Only HS256 Supported)

Valid ES256 JWT tokens are rejected at the Edge Functions API gateway with 401 Invalid JWT. The gateway only supports HS256 verification; ES256 requires a workaround to disable gateway verification and manually verify in the function.

highConfidence 87%Supabase Edge FunctionsStorageRealtime

Origin Analysis

Supabase Edge Functions API gateway uses the legacy HS256 shared secret for JWT verification and does not support ES256/JWKS. When the project uses an ECC P-256 signing key, the gateway cannot verify the signature and returns 401 before function execution. Setting verify_jwt=false in config.toml may not affect hosted deployments unless deployed with --no-verify-jwt or toggled in Dashboard.
1. Create a Supabase project with ECC (P-256) JWT signing key. 2. Create an Edge Function with default JWT verification enabled. 3. Obtain a valid ES256 JWT from Supabase Auth. 4. Call the Edge Function with the Authorization header. 5. Observe 401 Invalid JWT at gateway level, function code never executes.

Fixing Code Block

Edge Case Audit

Manual verification adds per-request overhead and depends on JWKS endpoint availability; consider caching to reduce latency. Ensure verify_jwt=false is actually applied in production or the gateway will still reject. This workaround makes the endpoint rely on code-level verification; if removed, endpoint becomes public. To rollback, switch project signing key back to HS256 (legacy shared secret) and redeploy with JWT verification re-enabled, or wait for official ES256 gateway support.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state