Skip to content

JWKS viewer

Paste a JSON Web Key Set to list every key’s id, type, algorithm, use and size, with its RFC 7638 thumbprint and certificate details.

Runs in your browser. Nothing you paste is sent to us.

Key set

A sample key set for the made-up realm acme is filled in. A Keycloak realm publishes its own at /realms/<realm>/protocol/openid-connect/certs.

Keys

No keys yet.

How to use it

  1. Open your realm’s certs endpoint in a browser and copy the JSON.
  2. Paste it into the box.
  3. Read each key: kid, kty, alg, use, size and, if present, the certificate’s subject and expiry.
  4. Check the warnings for missing kids, duplicate kids or private parameters.

What to know

A JWKS is the list of public keys an issuer signs or encrypts with. Clients fetch it and pick a key by the kid in each token’s header.

A Keycloak realm publishes its set at /realms/<realm>/protocol/openid-connect/certs. It lists signing keys (use sig) and encryption keys (use enc), usually with its certificate in x5c.

The tool also checks that x5t and x5t#S256 match the certificate, and warns if a set contains private key parameters, which must never be published.

What a JSON Web Key Set is

A JSON Web Key Set (JWKS, RFC 7517) is a JSON object with one member, keys, holding a list of JSON Web Keys. Each key describes one public key: its type, its numbers, and how it may be used.

Identity providers publish their public keys as a JWKS so that anyone can verify the tokens they sign. A client or API downloads the set, then picks the right key for each token by the kid in the token’s header.

What is inside a key

Every JWK has kty, the key type. The other members depend on the type.

MemberMeaningExample
ktyKey typeRSA, EC, OKP, oct
kidKey id, used to pick the keyAny string unique in the set
useIntended usesig for signing, enc for encryption
algThe one algorithm the key is forRS256, ES256, RSA-OAEP
n, eRSA modulus and exponentBase64url numbers
crv, x, yEC curve and pointP-256 with two coordinates
x5cCertificate chain, first entry holds this keyStandard Base64 DER
x5t, x5t#S256SHA-1 and SHA-256 thumbprints of the certificateBase64url hashes

Private keys add members such as d, p and q. A published key set must never contain them.

A shortened sample key set for the made-up realm acme
{
  "keys": [
    {
      "kid": "sample-acme-rs256",
      "kty": "RSA",
      "alg": "RS256",
      "use": "sig",
      "n": "6SoS-K45f5Qe…",
      "e": "AQAB"
    }
  ]
}

What this viewer shows

  • Each key’s kid, type, algorithm and use, with a label for signing or encryption keys.
  • The key size: RSA modulus bits, EC curve, or symmetric key length.
  • The RFC 7638 thumbprint, a stable SHA-256 identifier computed from the key itself.
  • For keys with x5c, the certificate’s subject and expiry date.
  • Whether x5t and x5t#S256 match the certificate.
  • Warnings for missing or duplicate kid values, short RSA keys, and private parameters in a public set.

It reads the JSON you paste; it does not fetch URLs. Open your certs endpoint in a browser tab and copy the response.

How to read a key set

  1. Open the key set URL in your browser. For Keycloak it is https://<host>/realms/<realm>/protocol/openid-connect/certs.
  2. Copy the whole JSON and paste it into the box.
  3. Check the key count in the panel title. A realm usually lists more than one key.
  4. For each key, read the use and algorithm, then the certificate expiry if there is one.
  5. Read any warnings. Private parameters in a published set are a serious problem.

Keycloak’s certs endpoint

Every Keycloak realm publishes its key set at /realms/<realm>/protocol/openid-connect/certs. The realm’s discovery document, at /realms/<realm>/.well-known/openid-configuration, gives the same URL as jwks_uri.

A new realm has an RSA signing key for RS256 and an RSA encryption key for RSA-OAEP, so the set normally shows at least one sig key and one enc key. Keycloak usually includes the key’s self-signed certificate in x5c, with the realm name as its subject.

HMAC and AES keys that a realm also holds are secret and never appear in the set.

Where the keys come from

In the admin console, Realm settings, Keys lists each key with its algorithm, type, kid, use and priority. The Providers tab shows the key providers that create them. When a realm has several keys for the same algorithm, the active key with the highest priority signs new tokens.

During a key rotation

To rotate, add a new key provider with a higher priority. New tokens then carry the new kid. Keep the old key enabled but passive until every token it signed has expired, so the set keeps listing it and older tokens still verify. Then disable or delete it.

Use cases

Configuring an API or gateway

Before you point a resource server at a jwks_uri, check what it will find: which algorithms, which key types, and whether any key would confuse a library that ignores use.

Answering “which key signed this?”

Copy the kid from a token’s header and look for it in the list. The key id matcher does this automatically and verifies the signature.

Auditing a key set

Look for short RSA keys, missing key ids, expired certificates, and keys nobody can explain. Each is a reason to rotate.

Common problems

  • The verifier picks an encryption key: some libraries ignore use. Make sure yours selects by kid and only uses sig keys for signatures.
  • The token’s kid is not in the set: the token came from another realm or server, or the verifier cached an old copy of the set.
  • Two keys share a kid: a client cannot tell them apart and may pick the wrong one.
  • The certificate in x5c has expired: Keycloak’s certificate is self-signed and most verifiers use only the key, but some libraries check the certificate dates. Rotate if yours does.

Fetching the set from the command line

You can also read a realm’s key set with curl and jq, which is handy on a server or in a script.

Listing key ids and algorithms for the sample realm acme
curl -s https://auth.example.com/realms/acme/protocol/openid-connect/certs \
  | jq '.keys[] | {kid, kty, alg, use}'

Paste the full response here when you also want sizes, thumbprints and certificate dates.

Checking a key set before going live

  1. Confirm every signing algorithm your realm or clients use has a matching sig key in the set.
  2. Confirm no key carries private members such as d.
  3. Confirm every key has a unique kid.
  4. Note the certificate expiry of each key, in case a verifier checks it.
  5. Verify one fresh token against the set with the signature verifier.

A key set that changes without anyone announcing it is worth a closer look. Compare today’s list of key ids with the one your verifiers cached, and make sure every new key was expected.

Keep a copy of the checked set with the date, so the next review can tell what changed.

Key sets from other providers

Every OpenID Connect provider publishes a key set at the jwks_uri in its discovery document, so this viewer works for any of them. When Keycloak brokers another provider, the identity provider settings can point to that provider’s key set to validate its tokens. Pasting the provider’s set here first shows which algorithms and key types Keycloak will have to handle.

Security notes

A JWKS is public by design. Publishing public keys is safe; publishing a private parameter such as d gives away the key. If the viewer warns about private parameters in a published set, treat the key as compromised and replace it.

Fetch key sets only over HTTPS and only from the issuer you trust. A verifier that downloads keys from a URL inside a token can be tricked into trusting an attacker’s keys.

Best practices

  • Give every key a unique kid, and set use and alg.
  • Use RSA keys of 2048 bits or more, or EC keys on P-256 or larger curves.
  • Cache the set in your verifiers and refresh it when an unknown kid arrives, with a limit on how often.
  • Rotate keys on a schedule and keep the old key listed until its tokens expire.
Questions

Frequently asked questions

Where is the JWKS URL for a Keycloak realm?

It is `https://<host>/realms/<realm>/protocol/openid-connect/certs`. The realm’s discovery document lists the same address as `jwks_uri`.

Why does my realm list more than one key?

Keycloak keeps separate keys for signing and encryption, and during a key rotation the old signing key can stay as a passive key so tokens issued before the change still verify.

What is the thumbprint?

A SHA-256 hash of the key’s required members in a fixed order, defined in RFC 7638. It identifies a key the same way everywhere, and many systems use it as the `kid`.

What is the difference between `use` and `alg`?

`use` says whether the key is for signatures (`sig`) or encryption (`enc`). `alg` names the single algorithm the key is meant for. Both are optional in RFC 7517, but verifiers work best when both are set.

Is it safe to share a JWKS?

Yes, if it holds only public keys, which is its purpose. It must never contain private members such as `d`, `p`, `q` or a symmetric `k`.

What are `x5c` and `x5t`?

`x5c` holds a certificate chain in standard Base64 DER, with the certificate for this key first. `x5t` and `x5t#S256` are SHA-1 and SHA-256 thumbprints of that certificate, Base64url-encoded.

Can I paste a single key instead of a set?

Yes. A single JWK object works too, and the viewer shows it as a set of one.

How often should a verifier refresh the key set?

Cache it, and fetch it again when a token arrives with a `kid` you do not have. Also refresh it on a regular interval so removed keys stop being trusted.

Why does the certificate in x5c say CN with my realm name?

Keycloak creates a self-signed certificate for each generated RSA key, with the realm name as its subject. Verifiers that use only the key ignore it.

Can a JWKS contain symmetric keys?

RFC 7517 allows `oct` keys in a set, but a published set must never contain them, because a symmetric key is a secret. Keycloak never publishes its HMAC or AES keys.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.