Opaque or JWT access tokens in Zitadel

How to decide between opaque access tokens with introspection and JWT access tokens with local validation for each Zitadel application, and what that choice does to revocation, API latency and key rotation.

On this page

Opaque or JWT access tokens in Zitadel: which one each application should use

Each Zitadel application should receive the access token type that matches its revocation needs, its exposure risk and how its APIs check tokens, and this decision is made per application. Zitadel implements OpenID Connect and OAuth 2.0, and the Zitadel APIs introduction describes the protocol surfaces involved. An opaque token is a random string that means nothing to anyone except the issuer, so an API must ask Zitadel what it represents through token introspection. A JWT (JSON Web Token) is a signed, self-contained document: the API reads the claims inside it and verifies the signature against the issuer's published keys without calling the issuer on each request. The token type is set in each application's configuration, so the first step is to confirm the current setting on every client you have registered.

The trade-offs come down to three questions. Revocation: an opaque token can be made invalid at the issuer, and the next introspection call reflects that, while a JWT remains valid until it expires unless the API checks a separate signal, so short lifetimes matter more with JWTs. Exposure: a JWT carries claims such as user identifiers, roles and audience in readable form, so every log, cache or proxy that handles it spreads that data, whereas an opaque token discloses nothing on its own. Latency and key rotation: introspection adds a call to the issuer for each request unless the API caches results, and JWT validation depends on the API fetching and refreshing signing keys, so a rotation the relying party has not picked up will break validation.

Turn these questions into a decision table before changing any settings. For each application and API, record whether the client is a browser, a mobile app or a server, how quickly a lost token must stop working, how many services will receive the token, and whether the API can reach the issuer within its latency budget. Then verify the choice with two tests in a non-production environment: revoke a session or grant and confirm that the API rejects the old token within the window you require, and rotate a signing key and confirm that every API picks up the new key. Check Zitadel's documentation for the release you run, since the options available to each application type depend on that version, and ask your implementation partner to put the decisions in writing before rollout.

Which token type fits which application pattern

This table compares opaque tokens checked through introspection, JWT access tokens validated locally, and a mixed setup across applications. Read each row as a trade-off you confirm for your own APIs, and use the typical fit row as a starting point rather than a final decision. The main takeaway is that revocation speed and Zitadel availability usually decide the choice more than raw latency.

FactorOpaque tokens with introspectionJWT access tokens with local validationMixed setup across applications
Revocation speedStrong: the resource server asks Zitadel on each check, so a revoked or disabled session is seen on the next call, subject to any caching you addWeaker: a valid signature stays valid until expiry unless you add revocation checks or keep lifetimes short. Confirm your required revocation windowDepends per application: apply the stricter model to APIs that handle sensitive actions
Exposure of claimsLow: the token is a reference string and reveals no user attributes to anyone who reads itHigher: claims such as subject, roles and audience are readable by anyone holding the token, so review which claims you emitVaries: keep sensitive claims out of tokens that reach browsers or third-party components
API latencyAdds a network call to Zitadel per request unless responses are cached, so plan for caching and load testing in your environmentLocal signature check with no call to Zitadel on each request, typically lower latency once the JWKS is cachedMixed: fast paths for low-risk APIs, extra checks for sensitive ones
Dependence on Zitadel availabilityHigh at validation time: if introspection is unreachable, protected APIs cannot verify tokens unless you design a fallbackLower at validation time: resource servers can verify tokens while Zitadel is down, but need the JWKS availableSplit by application, so an outage affects only the introspecting APIs
Key rotation effortLow for resource servers: rotation happens inside Zitadel, and APIs need credentials for the introspection endpoint to be maintainedModerate: resource servers must refresh cached signing keys and handle new key IDs, and every consumer must support the chosen algorithmBoth sets of work apply, so keep one inventory of which APIs use which model
Typical fitBackend APIs that handle payments, admin actions or data where fast revocation matters, and confidential clientsHigh-throughput internal APIs or services that tolerate short token lifetimes and can verify offlineOrganizations with several products, where each API's risk and traffic profile sets its model
What to confirmIntrospection credentials, caching window, the behavior when Zitadel is unreachable and expected loadToken lifetime, the claims emitted, JWKS caching rules, the signing algorithm each consumer supports and rotation stepsWhich applications and APIs fall into each model, who owns each decision and how changes are reviewed

How the choice changes API latency and key rotation

The token type you pick for each Zitadel application shifts where cost and risk land: on each API request, inside every relying party's key handling, and on the availability of Zitadel itself. The four cards below cover the places a load test and an operations runbook should look before you commit to one format.

Introspection round trips per request

With opaque tokens, every API call that is not cached asks Zitadel to confirm the token is active and to return its claims. Each request therefore adds a network hop to the identity service, and the cost grows with traffic. Check how many distinct tokens an API sees per minute, whether the API can cache introspection results, and how long a cached result can stay valid after a revocation.

Zitadel APIs docs

Local signature verification cost

With JWTs, the API checks the signature, issuer, audience and expiry locally, so the normal request path does not call Zitadel. Verification is cheap compared with a network call, but the signing algorithm and key size still affect CPU use on high-volume services. Measure verification time under peak concurrency with your chosen algorithm, not with a default benchmark.

JWKS caching in relying parties

A JWT API must hold the public keys that verify signatures, usually by fetching the JSON Web Key Set and caching it. The cache lifetime sets how quickly a new key is accepted and how long a retired key remains trusted. Confirm which library each service uses, whether it refreshes keys when it sees an unknown key identifier, and what happens when the key endpoint is slow or unreachable.

Key rotation effects on JWT consumers

Rotating a signing key is safe only when every consumer picks up the new public key before tokens signed with it are issued. Publish the new key early, keep the old key in the set until its tokens expire, and test a rotation with each API and client library in staging. A consumer that caches an old key set will reject valid tokens, which shows up as sudden 401 responses rather than a clean error at deployment time.

Availability dependency on Zitadel

Opaque tokens make Zitadel part of the request path for every uncached API call, so an identity outage or a slow database can stop APIs that were otherwise healthy. JWTs keep verification working during a short identity outage, though new tokens cannot be issued and revocation takes effect only at expiry. Decide how much downtime each API can tolerate and test what happens when Zitadel is stopped during a load test.

Setting the access token type on a Zitadel application

This sequence turns the opaque or JWT decision into configured applications and APIs, with a check at each stage that confirms the token type behaves as planned, including how revocation reaches each API.

  1. Inventory every client and API that receives tokens

    List each web, mobile, single-page and machine client that requests an access token, and each API that will accept it. Record which Zitadel project and organization each one belongs to, and whether any API sits in a different organization or instance. Someone from the platform team and the owners of each API should sign off on the list. The check is a table where every client has one or more named receiving APIs, so no token type is chosen for an application that has no defined consumer.

  2. Decide the token type for each application

    For each client, decide whether access tokens must be revocable within a short window and whether a leaked token should expose as little as possible. Applications that handle sensitive actions or where sessions end on sign-out usually lean toward opaque tokens with introspection. Applications with high request volume that need offline validation usually lean toward JWTs. Record the decision and the reason in the design document. The check is that every application has one recorded choice and a named owner who accepted the revocation trade-off.

  3. Set the access token type in the application configuration

    In the Zitadel console, open each application's configuration and set the access token type to match the decision, either opaque or JWT. Confirm the setting saved by reopening the application or exporting its configuration through the management API or Terraform, where your team keeps infrastructure as code. Confirm the setting for every application in the inventory, not only the new ones. The check is a configuration record for each client showing the chosen token type.

  4. Confirm the signing key and algorithm for JWTs

    For each application that issues JWTs, confirm which Zitadel web key signs the tokens and which JSON Web Algorithm it uses. Check that every API and client library in the inventory supports that algorithm and can read keys from the published key set. Record the key identifier so rotation can be traced later. The check is a decoded test token whose header shows the expected algorithm and key identifier, and whose claims include the expected issuer, audience and subject.

  5. Configure the validation path in each API

    Set up each receiving API to match its token type. JWT-based APIs validate signature, issuer, audience and expiry locally against the published keys, with a documented cache lifetime for those keys. Opaque-token APIs call introspection with their own credentials and decide access from the active flag and returned scopes. Document which path each API uses and who owns its credentials. The check is that each API accepts a freshly issued token and rejects one with the wrong audience.

  6. Test revocation against both token types

    Sign in as a test user, obtain one opaque token and one JWT from the same kind of client, then end the session or revoke the grant in Zitadel. Call each API with both tokens. The opaque token should return inactive from introspection once revoked. The JWT should continue to validate locally until its expiry, which confirms the short lifetime you chose is the real exposure window. Record the observed behavior. The check is a written result for each token type showing when access stopped.

  7. Record the operating rules for key rotation and latency

    Write down how signing key rotation reaches each JWT-validating API, including the cache lifetime for the key set and the expected behavior during rotation. Also record the latency added by introspection calls in the staging environment for opaque-token APIs, and whether introspection responses are cached. Assign an owner for each rule. The check is an approved operations note that a team can follow during the next rotation without consulting the original designers.

Opaque tokens go to Zitadel for a check on every call, JWTs are verified locally

The flow starts when a client calls a resource API with a bearer access token that Zitadel issued at the token endpoint. An opaque token is forwarded to Zitadel's introspection endpoint, so Zitadel decides whether it is still active and the answer can reflect a revocation. A JWT is checked by the API itself against signing keys it has cached from Zitadel's published key set, so no call to Zitadel happens per request. Check where the trust boundary sits and how long each cache is allowed to hold keys or introspection results.

Opaque tokens need a Zitadel call per check, while JWTs are verified against cached keys.

Security risks of each token type and how to reduce them

Opaque and JWT access tokens fail in different places. Opaque tokens move risk onto the introspection path, while JWTs move it onto expiry, claim exposure and key distribution. The cards below name the risks that matter for each choice and the checks to run before a Zitadel application goes live.

Long-lived JWTs outlive revocation

A JWT stays valid until its exp claim passes, and a relying API that validates it locally has no built-in way to learn that the user was disabled or the session ended. Keep access token lifetimes short for applications that issue JWTs, and confirm how each Zitadel application's token lifetime is set. Decide which events, such as a removed role or a disabled user, must cut off access early, and whether an opaque token suits those APIs better.

Zitadel APIs introduction

Claims visible to clients and intermediaries

A JWT is signed, not encrypted, so anyone holding it can read its claims, including user identifiers, organization IDs, roles and email addresses. Browser storage, proxy logs and analytics tools can all capture the token. Keep sensitive attributes out of the token where the API does not need them, and avoid logging full bearer values in gateways and application logs.

Introspection endpoint exposure

Opaque tokens are only useful if the resource server can ask Zitadel whether they are active, and that call must be authenticated. An introspection endpoint reachable without client credentials, or called with a shared secret stored in plain text, lets attackers test stolen tokens or learn token details. Confirm which client authentication method each API uses, restrict who can reach the introspection path, and monitor call volume for unusual spikes.

Weak or mismatched audience checks

A token issued for one API can be accepted by another if the receiving service skips the aud check or accepts any audience value. This applies to both token types, but JWTs make the mistake easy to repeat because the claim is readable and the check is easy to omit in custom code. Require each API to verify its own audience, reject tokens that name other resources, and test with a token minted for a different API.

Stale JWKS caches after rotation

When Zitadel rotates signing keys, a relying party that caches the JSON Web Key Set too long will reject new tokens, and one that refreshes too eagerly adds load and latency. Verify that each API refreshes keys when it meets an unknown key ID, and that the cache lifetime is set deliberately. Rotate keys in a planned window and watch validation errors during the change. The signing algorithm and key handling are covered in the web keys topic.

Token leakage through redirects and storage

Access tokens that pass through redirect URLs, query strings or long-lived browser storage can leak to other sites, browser extensions or shared devices. Use the authorization code flow with PKCE for browser and native clients, and avoid placing tokens in URLs. Review where each application stores tokens and set the shortest practical lifetime for the data they reach.

Operating both token types after go-live

Once the token type is set for each application, the work shifts to keeping it healthy. For opaque tokens, the metric to watch is introspection latency and error rate at the Zitadel introspection endpoint, measured from each API's point of view rather than Zitadel's. Track p95 latency, timeouts, HTTP 401 and 5xx responses, and the cache hit rate in each relying party. A rising error rate on introspection often means a client credential problem, a network path change or a database slowdown, not a token problem. For JWT clients, watch the opposite signal: how often APIs fetch the JWKS document, and whether any service still rejects tokens after a key change.

Key rotation is the JWT-side task that most often breaks production. Zitadel signs JWTs with web keys, so plan each rotation with an overlap window in which the old and new keys are both published, and confirm that every relying party refreshes its JWKS cache before the old key is retired. Check that each API's JWKS cache lifetime is shorter than your overlap window, and test a rotation in staging with a token signed by the old key still in flight. Record which algorithm each application and API accepts, because a rotation that changes the algorithm is a separate change with its own testing. Confirm the exact rotation procedure and cache behavior in the Zitadel documentation for your release.

Token lifetimes and outage behavior need a review each time the access policy changes. Shortening an access token lifetime increases refresh traffic, and for opaque tokens it increases introspection load, so re-run your capacity assumptions after any change. Rehearse a Zitadel outage with the team that owns each API: decide whether APIs fail closed, serve cached introspection results for a bounded period, or continue with unexpired JWTs until expiry, and write that decision down. Before any Zitadel upgrade, read the release notes for your target version and confirm that your PostgreSQL version is within the supported range of 14 through 18, because a database version outside that range can block an otherwise routine upgrade.

Questions teams ask before choosing a Zitadel token type

Can one token type be used for every application in Zitadel?

Yes, the token type is set per application, so a single Zitadel instance can issue opaque tokens to some clients and JWTs to others. Teams usually decide by risk and by how each API validates tokens. A browser-facing single-page app, a mobile app and a server-side API may each need a different choice. Mixing types is workable, but every API that receives a token must know which type it will get. Document the decision per application in your access design so that API teams do not assume the wrong format.

How much work is it to change a Zitadel access token type later?

Changing the type is a configuration change on the application, but the effort lies in the APIs and clients around it. Each resource server that parses tokens must move from local JWT validation to introspection, or the reverse, and must be tested with real tokens. Caches, gateway policies and any code that reads claims from the token body also need review. Ask for an inventory of relying parties and APIs before scheduling a change, because that inventory is the main driver of cost and duration.

What must a JWT-validating API get right?

A JWT-validating API must verify the signature against the published keys, check the issuer, check the audience, check the expiry, and enforce the roles or scopes it depends on. It must also fetch and cache the JSON Web Key Set correctly, so that it accepts tokens signed with a new key after rotation. Key rotation is where many failures appear: an API that caches keys too long rejects valid tokens, and one that refetches on every request adds load. Confirm the signing algorithm each API supports before issuing tokens, and see the related Zitadel web keys guidance for the algorithm and rotation steps.

How does token introspection affect API load and latency?

Introspection adds a call from the API to Zitadel for each token it has not yet validated, so request volume and latency to the identity provider both matter. Caching introspection results for a short period reduces the load, but it also delays the effect of revocation by the cache lifetime. The real cost depends on request rate, cache hit rate, network distance between the API and Zitadel, and how many APIs share one instance. Ask for a load test that uses your traffic pattern, and measure p95 latency with and without caching before choosing.

What would a partner scope and what must our team provide?

A partner scopes the work from the application and API inventory: which clients exist, which token type each needs, how each resource server validates tokens, and what revocation and rotation rules apply. Your team provides the inventory, the owners of each API, access to test environments, the required signing algorithm and the target load profile. The written scope should list the relying parties covered, the test cases, the load test runs and the handover documents. Ask the partner to state which parts depend on your teams and what happens if those inputs arrive late.

What drives the cost of this decision, and what should we ask in a quote?

The main cost drivers are the number of APIs that validate tokens, the number of relying parties and clients, the number of token types in use, and the scope of load testing. Each additional resource server adds integration and test work, and each new signing key rotation adds verification steps. Ask for a quote that lists each API and client by name, the token type for each, the test environments included, the load test profile and the retest rules. Recurring costs usually come from rotation, client onboarding and load testing after traffic changes.

Can our team make this decision alone?

Yes, if your team has an accurate inventory of APIs and clients, engineers who understand OIDC token validation, and a test environment that matches production traffic. Many teams decide the token type internally and use a partner only for the load tests or for the validation changes across many APIs. The decision is harder when APIs are owned by several teams, when revocation requirements are strict, or when no one has measured introspection latency. Use the inventory and load results to judge whether your own staff can carry the change safely.

Limits to confirm in your Zitadel version and environment

Token type decisions depend on details that change between Zitadel releases and between environments. The cards below list what to confirm for your version, your client libraries and your gateway, and who signs off on token handling. Check each item with Zitadel documentation or in a test environment before you fix the design.

Token lifetime and format options

Confirm which access token formats your Zitadel version offers for each application type, and what lifetime defaults apply. Lifetimes set how long a stolen token stays useful, and they also set how often clients refresh and how often APIs call introspection. Record the chosen values per application, including refresh token behavior, so the trade-off is written down. Test an expired token and a revoked token in a staging instance to see how your APIs respond.

Zitadel APIs introduction

Introspection and JWT library behavior

Check that your client and resource server libraries handle the token type you choose. Some libraries validate JWTs offline by default, while others only support introspection or require extra configuration for it. Confirm how each library handles audience checks, issuer matching and clock skew. Run a request with each token type through every service that will consume it, not only the ones your team wrote.

Supported signing algorithms and key settings

Confirm which JSON Web Algorithms your Zitadel version uses for signing and which key types are available through web keys. Every relying party and gateway must accept the algorithm you pick, or validation fails after a change. Confirm how long old public keys stay published during rotation, and how relying parties cache the key set. A rotation test that leaves a single service on a stale key set will show this quickly.

Gateway and proxy handling of long tokens

JWTs are larger than opaque tokens, and some gateways, load balancers and proxies limit header size. Check the maximum header size at every hop, including ingress controllers and API gateways, and test with tokens that carry your full role and audience claims. Confirm that the gateway forwards the token unchanged and that any introspection calls it makes do not add a latency spike under load. Record the limits you measured in your own environment.

Compliance review of token handling

Ask your compliance team which evidence they need for token lifetime, revocation, key rotation and logging of token use. An opaque token design leans on introspection logs and revocation records, while a JWT design leans on key management and expiry controls. Agree on the controls and evidence before the design is built, because changing token type later changes what must be reviewed. Confirm each point with Zitadel documentation and your own test results, then take it to your auditors.

How DeployOpen scopes token design for Zitadel

DeployOpen starts token design with an inventory of every application and API that will call your self-hosted Zitadel instance. For each one we record the client type, the resource servers that will accept its tokens, the expected session length, how quickly access must be revoked after a user is disabled or a role changes, and the latency budget of the endpoints involved. That inventory becomes a written decision per application: opaque access tokens validated through introspection, or JWT access tokens validated locally with the web keys published by the instance. The decision, its reasons and the owner of each client are recorded in the scope document before any configuration changes are made.

Both validation paths are then built and tested inside your own infrastructure, against your own Zitadel deployment and your own API gateways or services. For opaque tokens, the work covers introspection credentials, where the introspection call is made, and caching limits. For JWTs, it covers audience and issuer checks, the algorithm allow list, and how relying parties refresh the published key set. Test cases include revoked and expired tokens, a rotated signing key and a failed introspection endpoint, so your team sees how each path behaves when something goes wrong. Your engineers should confirm the current token and introspection options in the Zitadel documentation for the version you run, because those details change between releases.

The final deliverable is a rotation and monitoring runbook. It describes how signing keys are rotated without breaking clients, which dashboards and alerts show introspection errors or unexpected token volume, and who acts on each alert. DeployOpen delivers the runbook with the configuration, test results and a short walkthrough for the operations team. Engagements are fixed-scope, so the applications covered, the deliverables and the timeline are agreed in writing before work starts. Ongoing support, key rotation reviews and continuous testing are available as a retainer once the design is live.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.