Choosing the Zitadel token signing algorithm with web keys

Choosing the Zitadel token signing algorithm with web keys decides which keys sign your tokens, which relying parties must verify them and how you rotate keys without outages.

On this page

Choosing the Zitadel token signing algorithm before your first client goes live

The signing algorithm and the web key that carries it decide which relying parties can validate the tokens your Zitadel instance issues. A web API, a mobile app, a single-page app and a machine client each verify JWT access tokens or ID tokens against a published key, and each verifier must support the algorithm the key uses. Choose the algorithm before the first client goes live, because every service you add later inherits that choice.

In Zitadel, a web key is the signing key pair that Zitadel uses to sign JWTs, and its public part is published through the JSON Web Key Set endpoint so relying parties can verify signatures offline. Zitadel's documentation describes how web keys are created, activated and rotated. Confirm the list of supported JSON Web Algorithms in the web keys documentation for the exact Zitadel version you deploy, since the set of options can change between releases. Do not assume a library default or an algorithm from an older deployment guide applies to your version.

This decision is needed in four situations: a new deployment, the addition of a new API or gateway that validates tokens, a security review that questions key strength or algorithm choice, and a scheduled or forced key rotation. The algorithm is hard to change later because each relying party caches keys and enforces its own accepted algorithm list, so a switch can break validation for clients you do not control. Before you commit, inventory every language library, gateway and framework that will verify tokens, and confirm each one accepts the chosen algorithm.

How Zitadel signs tokens and how relying parties find the public key

The diagram starts with a client signing in through Zitadel, the issuer, which signs the token with its active web key. The client then presents the token to an API or gateway, which is the relying party. The relying party fetches the public key set from the JWKS endpoint and caches it, so it can validate tokens offline. The boundary between issuer and relying party is where you check that the key algorithm is supported on every side, and that a newly published key appears in the JWKS before Zitadel starts signing with it.

Tokens are signed by the issuer and verified by relying parties using cached public keys.

Signing algorithm options and when each fits

This table compares the RSA, elliptic curve and EdDSA signing families on key size, performance, library and gateway support risk, and fit for offline JWT validation. Use it as planning guidance, confirm the exact algorithm identifiers Zitadel offers for your deployed version, and pick an algorithm that every relying party can verify.

Algorithm familyKey size and performanceLibrary and gateway support riskFit for offline JWT validation
RSA (RS256 family)Large keys and signatures; signing and verification cost is higher than elliptic curve options, and token size growsLowest risk. Most JWT libraries, API gateways and proxies accept it, including older clientsGood fit when broad compatibility matters more than token size; confirm each validator accepts the chosen key length
RSA with PSS padding (PS256 family)Similar key sizes and cost to RSA PKCS#1 v1.5; verification speed is the main trade-off to measureLow to moderate risk. Some older libraries and gateway plugins support only the PKCS#1 v1.5 variantFits offline validation where the validator is confirmed to support PSS; test before committing
Elliptic curve P-256 (ES256 family)Small keys and signatures with fast verification, which suits high-volume APIs and short tokensLow to moderate risk. Widely supported in modern libraries, but some gateways and older SDKs need explicit configurationStrong fit for offline validation when every relying party is confirmed to handle ECDSA and the JWKS key type
Elliptic curve P-384 or P-521 (ES384, ES512 families)Larger keys and slower operations than P-256, with stronger curve sizes for policies that require themModerate risk. Fewer libraries and gateways are tested with these curves, so verify each oneUsable offline where a policy requires a larger curve, but confirm support in every validator first
EdDSA with Ed25519Small keys, fast signing and verification; the algorithm and key type are newer for JWT useHighest risk in mixed environments. Many gateways, mobile SDKs and older libraries lack supportFits offline validation only when all relying parties, including third-party and mobile code, are confirmed to verify EdDSA
Any choice, validation stepMeasure token size and verification time in your own load test before decidingInventory every client, API, gateway and SDK, and test each one against the chosen identifierThe choice must match what every relying party can verify; confirm identifiers in Zitadel documentation for your version

Checking that every client and API supports the Zitadel signing algorithm

A key change only succeeds if every component that validates Zitadel tokens can read the new algorithm and key format. The cards below cover the places where that support can silently break, with the check for each and the team that should own it. Run each check in a non-production environment before you switch the signing key.

Resource APIs and JWT libraries

Every API that validates Zitadel access tokens locally depends on a JWT library to verify signatures against the JWKS document. Check the library version, confirm it supports the algorithm you chose and the key type it implies, and confirm it rejects algorithms outside your allow-list. Pin the library version in the API build so a dependency update cannot change verification behavior unnoticed. The API team owns this check, and it should cover each language runtime separately.

Zitadel APIs docs

API gateways and ingress controllers

Gateways that validate JWTs before forwarding requests may use their own verification plugin with its own algorithm list and key cache. Confirm the plugin accepts the new algorithm, that it loads keys from the Zitadel JWKS endpoint, and how it refreshes keys after a rotation. A gateway that rejects the new signature returns authorization failures for every route it protects. The platform or gateway team owns this check.

Reverse proxies and service meshes

Some proxies and meshes perform JWT authentication or header inspection with a configured key set. Confirm that the proxy version parses the key format in the JWKS response and that any static key or cached configuration is updated during rotation. Verify that the proxy does not strip or alter the Authorization header in ways that break validation downstream. The platform team owns this check together with the owners of the mesh configuration.

SPA and mobile SDKs

Browser and mobile SDKs usually validate ID tokens on the client and may restrict accepted algorithms in their configuration. Check the SDK release notes for the algorithm you chose, and test sign-in on each supported browser and mobile OS version. A client that fails silently can loop users back to the login page. The application team that owns each client should run this check and record the SDK version tested.

Backend frameworks and middleware

Web frameworks often ship authentication middleware with default algorithm settings, and some default to a list that excludes newer options. Confirm the middleware accepts the configured issuer, audience and algorithm, and that its key discovery follows the jwks_uri from the discovery document. Test a token signed with the new key and a token signed with a retired key during the overlap window. The backend engineering team owns this check.

Third-party tools that call your APIs

Partner integrations, reporting tools, automation platforms and CI jobs may verify tokens themselves or pass them through without checking support. Inventory every external consumer that validates signatures, ask each owner for the algorithms and key formats they accept, and agree a notification date before the change. Keep a contact list so a failed integration reaches someone who can fix it. The integration or vendor management owner should track this inventory and sign off the cutover.

Setting up Zitadel web keys and the signing algorithm

This sequence takes a self-hosted Zitadel instance from an unchecked default to a documented web key that every relying party verifies. Each step ends with a check, so the signing algorithm is confirmed in practice before any production client depends on it.

  1. Confirm the deployed Zitadel version and key options

    Record the exact Zitadel version running in each environment, then check the web key settings that version offers in the console and its documentation. The v4.19.5 release is the latest version named in our research, so confirm whether your deployment matches it or runs an earlier release. Confirm the supported JSON Web Algorithms for that version before choosing anything, because options can differ between releases. Done when you have a written note of the version, the available algorithms and the environment it applies to.

  2. Inventory every relying party and its algorithms

    List each application, API, gateway and library that validates Zitadel tokens locally, along with the JWT libraries and versions they use. For each one, confirm which signing algorithms it accepts and whether it can read keys from a JWKS endpoint. Flag anything that accepts only a narrow set of algorithms or requires a static key file. Done when every relying party has a row showing its owner, library, accepted algorithms and JWKS support, and no item is left as unknown.

  3. Select the algorithm and create the web key

    Agree on one algorithm that every inventoried relying party accepts, then create the web key in the target instance with that algorithm. Record who approved the choice and why it was made, because a later change will require the same review. If a legacy client accepts fewer algorithms, decide with its owner whether to upgrade it or keep a separate key for it. Done when the key appears in the instance with the agreed algorithm and the approval is recorded.

  4. Point test relying parties at the JWKS endpoint

    Configure each test relying party to fetch keys from the instance's JWKS endpoint rather than from a copied key file. Use a staging instance first and confirm that the issuer URL in each configuration matches the instance domain exactly. Confirm that the relying party selects keys by key identifier and not by position in the list. Done when each test relying party loads the key set without errors in its startup or debug log.

  5. Issue test tokens and validate them

    Request tokens from a test client for at least one user and one machine identity, then validate each token in every test relying party. Check the header algorithm, the key identifier, the issuer, the audience and the expiry. Confirm that a token signed with the new key is accepted and that a tampered token is rejected. Done when every test relying party accepts valid tokens and rejects the tampered one.

  6. Confirm no signature errors in relying party logs

    Watch each relying party's logs through a full token lifecycle, including a refresh and a first request after a cache expiry. Look for signature verification failures, unknown key identifier messages and algorithm mismatch errors. Repeat the check for each library version found in the inventory. Done when the logs show no signature errors across the test period and the results are saved with the test record.

  7. Record the chosen key identifier and rotation plan

    Write down the key identifier, the algorithm, the instance, the creation date and the owner of the key in the configuration record. Document how relying parties refresh their cached key sets and how long a retired key must remain published so that tokens already issued still validate. Ask Zitadel and your library vendors to confirm the rotation behavior for your versions. Done when the record is stored with the environment configuration and the rotation steps are written for the operations team.

Rotating Zitadel web keys without breaking relying parties

Rotation is safe only when every relying party picks up the new public key before Zitadel starts signing with it. The sequence is publish, wait, switch, retire: add the new key to the JWKS endpoint so relying parties can fetch it, give their caches time to refresh, switch Zitadel's signing to the new key, and remove the old key only after every token signed with it has expired. Relying parties that validate access tokens locally depend on the JWKS document rather than on a single static key, so the rotation timing is governed by their cache behavior as much as by Zitadel. Confirm in the Zitadel documentation how web keys are published, how many keys can be active at once, and which key Zitadel selects for signing when several are present. Those answers determine how long the overlap window must last.

The most common failure is a relying party that pins one public key in configuration, a library setting or a copied PEM file. Once Zitadel signs with a new key, that service rejects every new token with a signature error while older tokens still validate until they expire, so the outage can look intermittent. Inventory every API, gateway and library that validates Zitadel tokens and record whether each one fetches keys dynamically by kid or holds a fixed copy. Check how each one handles an unknown kid: some refresh the JWKS on a miss, others wait for a fixed interval, and some do neither. A test rotation in a non-production instance, with one token issued before and one after the switch, will show the actual behavior before production is affected.

Schedule rotation as a planned change, not as an emergency response to a suspected key exposure. Rotation and a Zitadel upgrade both change what signs and validates tokens, so run them in separate change windows, or at least confirm that the upgrade release does not alter key handling before combining them. Read the release notes for the version you are moving to in the zitadel/zitadel releases page before planning. Keep a written record of the active key ID, the switch time, the maximum token lifetime in each client and API configuration, and the date the old key was retired. Rotation and retirement dates should be set from the longest access token lifetime in use, plus the cache interval of the slowest relying party, and that combined figure should be confirmed in your own environment rather than assumed.

JWKS caching in relying parties by environment

Backend APIs that validate JWTs locally usually rely on a JWT library or framework middleware that fetches the JWKS from the issuer's discovery document, stores the keys in memory, and reuses them for every request. The library decides how long keys stay cached, whether a missing key ID triggers a fetch, and how often a background refresh runs. Your API team owns these settings, so they should be written down and tested rather than left at defaults.

  • Cache location: Keys usually live in process memory, so each replica holds its own copy and fetches independently after a restart.
  • Stale key window: Ask whether the library keeps a key after the issuer removes it, and for how long. Some libraries cache for a fixed interval with no signal from the server.
  • Key ID miss: A token with an unknown kid should trigger one refetch, rate limited, before the request is rejected. Confirm the library does this and does not refetch on every failed request.
  • Too long: A long cache keeps accepting tokens signed with a retired key after rotation, which widens the exposure window.
  • Too brief: A short cache or a fetch per request adds load on the JWKS endpoint and adds latency to every call.

Confirm each library's refresh behavior in its own documentation and test a rotation in staging before relying on it.

Security considerations for signing keys and algorithm choice

A signing key is only as trustworthy as the people who can change it, the systems that hold it and the relying parties that decide which algorithms to accept. The cards below cover the decisions and checks that connect algorithm choice to administrator access, key recovery, audit and incident response.

Restrict the algorithm allow-list

Each API and client library should accept only the algorithm you chose for web keys, and reject tokens that name any other algorithm in their header. Algorithm confusion attacks succeed when a validator trusts the algorithm named inside the token instead of its own configuration. Check every relying party's JWT library for an explicit allow-list setting, and test by sending a token signed with an algorithm you did not configure. Confirm the behavior with each library's documentation rather than assuming a default.

Zitadel APIs docs

Control who manages web keys

Creating or deleting a web key changes which tokens every relying party will accept, so it is a privileged action. Decide which administrator roles in the Zitadel administrator console can create, rotate or delete keys, and keep that set small and separate from day-to-day user administration. Verify the role assignments periodically and record who holds them. Ask your team to confirm that no service account or shared login can perform key changes without a named owner.

Protect the private key and its backups

The private signing key is the secret that lets anyone mint tokens your APIs trust, so its exposure is a full authentication compromise. Confirm where Zitadel stores the key material in your deployment, who can read the database and cluster secrets that hold it, and whether database snapshots and backup copies are encrypted and access-limited to the same people. Treat backup tapes, replicas and exported dumps as copies of the key.

Plan key recovery around the masterkey

Recovering signing keys after a failure depends on the masterkey that Zitadel uses to protect encrypted data, together with a restorable database backup. Losing the masterkey can leave restored data unreadable, and restoring a database without the matching key state can break token validation. Document where the masterkey is stored, who may retrieve it, and how a restore is tested end to end, including a check that relying parties accept tokens afterward. Confirm the exact recovery steps for your Zitadel version with the vendor documentation.

Audit every key change

Key creation, rotation, activation and deletion should each leave a record that names the actor, the time and the affected key. Confirm that your Zitadel deployment exposes these events to your logging pipeline, and that they reach storage your security team can query independently of Zitadel administrators. Compare the audit trail against your change tickets during reviews, since an unexplained key change is an early indicator of misuse. Ask the vendor which key events are logged by default.

Respond to suspected key compromise

If a private key may have leaked, you need to stop trusting it quickly and let relying parties pick up the change without a long outage. Prepare a runbook that adds a replacement key, removes or disables the suspect key, forces relying parties to refresh their cached JWKS, and invalidates tokens issued under the old key where your design allows it. Rehearse the runbook before you need it, and agree in writing who can authorize each step.

Questions teams ask about the Zitadel signing algorithm and web keys

How much effort does choosing the signing algorithm and testing compatibility take?

The decision itself is quick, but compatibility testing is where the effort sits. Effort depends mainly on how many clients, APIs and gateways must validate the tokens, how many of them use libraries you have not checked against the chosen algorithm, and whether any of them cache keys or hardcode an algorithm. A small estate with current libraries is far simpler than a mix of older services, third-party products and internal frameworks. Ask any partner for a quote built from a written inventory of every relying party, the library version each one uses, and the test cases that will prove each one accepts the chosen algorithm before any production change.

How long does a web key rotation take to plan and run?

Duration depends on the number of relying parties that must pick up the new key, how quickly each one refreshes its JWKS cache, and how many change windows your organization requires. Planning covers the overlap period in which both the old and new keys are published, the order in which teams update, and the rollback steps if a service rejects tokens. Confirm with your own change board how many windows you need and with Zitadel's current documentation how keys are published and retired in your release. Ask for the rotation plan as a written deliverable with dated steps, since a quote without that schedule cannot be compared.

What does the work need from our team?

Your team provides three things: an inventory of every API, gateway, mobile app and single-page app that validates Zitadel tokens, with owners and library versions; test environments that mirror production token flows closely enough to prove the change; and change windows agreed with the teams that run each relying party. Your security team should also confirm which algorithms your policy allows and who approves the final choice. Missing inventory is the most common reason rotation work expands, so require it before the scope is written.

Can our own team do this without outside help?

Yes, if you have people who can read token validation code, run the test matrix and coordinate changes across teams. Outside help is most useful when many relying parties are owned by different teams, when some are third-party products whose algorithm support you must confirm with the vendor, or when no one on staff has run a key rotation before. Compare the cost of your staff's time against a fixed-scope engagement, and ask whether any partner will hand over the test cases and runbooks so your team can repeat the process later.

Is changing the signing algorithm later harder than choosing it now?

Usually yes, because every relying party that validates tokens must support the new algorithm before the switch, and the old one must remain published during the overlap period. The cost of a later change grows with the number of integrations added since the first decision. Choosing deliberately at the start, after checking each client and API, keeps the first deployment simple. If you already run Zitadel, the change is still manageable, but it should be treated as a planned migration with its own inventory and test cycle, not a configuration tweak.

What should a quote for this work include?

A quote should state the scope in writing: the list of relying parties covered, the algorithm options assessed, the compatibility tests to run, the rotation steps and rollback plan, and the documentation delivered. It should name what the client provides, including inventory, environments and change windows, and what happens if an integration cannot be validated. Ask whether the work covers JWKS caching guidance for each relying party, whether a retest is included, and whether ongoing support is a separate retainer. DeployOpen does not publish a price list, and every engagement is fixed-scope with terms agreed in writing before work starts.

Which parts of the work are hardest to get right?

The hardest parts are usually the relying parties you forgot, such as internal scripts, older libraries or gateways that cache keys for long periods, and clients that hardcode an algorithm. Engineers should confirm that each validator reads the key identifier from the token header, refreshes its JWKS cache when an unknown key appears, and rejects tokens signed with algorithms it does not expect. Test both the happy path and the failure path, including expired keys and a retired key still in a cache.

Limits to confirm in your Zitadel environment

The supported algorithms, key limits and propagation behavior for Zitadel web keys depend on the version you run and how your instances are set up. Treat each item below as a check to complete in your own environment, not as a fact to assume from this page. Each card names one thing to confirm and why it affects your signing choice.

Algorithms offered for web keys

Confirm which JSON Web Algorithms your deployed Zitadel version offers when it creates a web key. The list in a newer release may differ from the one you saw when you first set up the instance, so check the version you actually run rather than the latest documentation. Record the exact algorithm names you intend to use, because the choice constrains every relying party that validates tokens.

Zitadel APIs

Active keys at one time

Confirm how many web keys can be active at once in your version and whether a new key can be published alongside the current one during rotation. The answer decides whether you can roll keys without a window where some tokens cannot be verified. Ask Zitadel or check the release notes for the limit and the default key lifetime.

Key separation by token type

Confirm whether ID tokens, access tokens and other token types can be signed with different web keys or must share one. Separate keys can limit the impact of a compromise and simplify rotation for one token type, but they also add more keys for relying parties to fetch. Test how your version assigns keys before you write the rotation runbook.

Key propagation across instances

In a multi-tenant setup, confirm how a key change reaches each instance and organization that signs tokens for its own customers. Check whether keys are scoped per instance, whether a change applies to all organizations at once, and how long a stale key remains in use. Note the answer in your tenant onboarding and offboarding procedures.

Relying parties that reject unfamiliar algorithms

Inventory every client library, API framework and gateway that validates Zitadel tokens and confirm each accepts the algorithm you choose. Some libraries reject algorithms outside a fixed allowlist, and some gateways ship with older defaults. A single component that refuses the new algorithm can block sign-in for an entire application, so test each one against a token issued by your instance.

Key behavior in your version's docs

Confirm that the version you run includes the key behavior described in its current documentation, including rotation steps, JWKS endpoint contents and caching guidance. Documentation can describe features added after your release, so compare the page against the release notes for your exact version. Where the two differ, plan against the behavior your version has been tested to show.

Zitadel releases

How DeployOpen scopes and delivers the signing key work

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, so signing key decisions for Zitadel are made against your real client and API inventory. Each engagement starts with a written scope that defines which applications, resource servers and key operations are covered before any change is made.

How we scope

  • We inventory every Zitadel application and API that validates tokens, including the libraries and versions each one uses.
  • The written scope lists which web key algorithm is targeted and which relying parties must be confirmed or updated first.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • We configure web keys in your Zitadel instance and test token issuance and JWKS retrieval in a non-production environment first.
  • We verify signature validation, audience and issuer checks, and JWKS caching behavior in each relying party against the chosen algorithm.
  • We design the key rotation runbook and test a rotation with overlapping keys before any production change.

How we hand over

  • You receive the compatibility matrix, configuration records, test results and the rotation and rollback runbook.
  • Documentation covers which relying parties cache JWKS, how long, and how each team should refresh keys after rotation.
  • We walk your platform, security and application teams through the handover so they can operate the setup without us.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, including checks after Zitadel upgrades.
  • Retesting of affected relying parties can be included when a new client library or algorithm is introduced.
  • Confirm with DeployOpen, in the written quote, what support window and retesting frequency apply to your environment.

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.