Verify end-user JWT claims directly at your AI endpoint
Let web or mobile apps pass Auth0, Clerk, or Supabase JWTs straight to APIkit—verifying signatures and claims without a proxy server.
Steps to secure browser calls with JWT auth
- 01
Configure exact JWKS and issuer
Lock verification to your exact issuer URL and audience string so foreign tokens fail validation.
- 02
Require short token lifetimes
Reject expired JWTs strictly and avoid disabling clock-skew tolerances beyond brief seconds.
- 03
Map verified claims to quotas
Key per-user rate limits on the verified sub or org_id claim rather than unverified headers.
- 04
Combine JWT auth with strict CORS
Pair token validation with explicit allowed browser origins for defense in depth.
Common questions
Can a React app safely call APIkit directly with an end-user JWT?
Yes. Because no long-lived APIkit secret is embedded in frontend code—only the signed user session JWT—calling directly is secure.
Which identity providers work with JWKS verification?
Any standard OIDC/JWT provider publishing a JWKS endpoint works out of the box, including Clerk, Auth0, Supabase, Cognito, and Firebase.
What if a user alters the role claim in their token?
Tampered tokens immediately fail cryptographic signature verification against your provider's public JWKS keys.
Related tasks in this category
See all in API Key Auth, Scopes & Quotas-
Issue scoped API keys per customer and environment
Generate prefixed keys restricted to specific endpoints, read-only routes, or workspaces—no custom auth database required.
-
Meter and cap monthly token quotas per tenant
Track exact prompt and completion token usage per workspace, warn at 80%, and enforce clean monthly caps without building Stripe metering pipelines.
-
Rotate API keys smoothly with overlapping grace windows
Issue replacement API keys with a configurable 24-hour or 7-day overlap window so mobile workers and cron jobs migrate without outages.
-
Lock internal AI endpoints to approved IP and CIDR ranges
Ensure B2B partner integrations and internal admin pipelines only accept traffic from static VPN, VPC NAT, or enterprise IP blocks.
-
Configure exact CORS origin policies for browser clients
Allow your production domains and preview deployments to call endpoints cleanly while blocking unauthorized third-party sites.
-
Shield public unauthenticated AI forms from bot abuse
Keep interactive landing-page demos and public lead widgets safe from scripted prompt drain using origin checks, payload caps, and Turnstile tokens.