liveBook · Manning

JSON Web Key

As explained in Secure APIs

A JSON Web Key is a JSON data structure representing a cryptographic key and its associated parameters.

A JSON Web Key (JWK) is a standard JSON data structure representing a cryptographic key and the parameters needed to load and use it. Fields such as kty identify the key family, while algorithm-specific values describe the key itself. section 7.5.2 section 8.4.2

Common JWK fields include:

  • kty identifies the cryptographic key type, such as RSA or EC. section 8.4.2
  • use indicates whether a public key encrypts data (enc) or validates signatures (sig). section 8.4.2
  • kid identifies a particular key, while RSA keys use values such as n and e to represent the modulus and public exponent. section 8.4.2

Validating an OIDC access token

An OIDC provider publishes public JWKs through its JWKS endpoint. A validator reads the JWT header’s kid, selects the matching JWK, loads its public key, and verifies the token with a fixed algorithm such as RS256, expected audience, and issuer. section 8.4.2 section 8.7

How Secure APIs covers it

How deep it goes
Explains definitions, important fields, JWKS lookup, and validation flow, while deferring complete JWK specification details.
Examples
Shows RSA and elliptic-curve JWK objects, a JWKS endpoint, and JWT headers selecting keys through kid.
What it assumes
Assumes familiarity with cryptographic keys and JWTs while defining JWK fields and key selection in context.
What you can do after
Apply it via PyJWT to select a JWKS signing key and validate a token’s signature, audience, and issuer.
How it connects
Connects JWKs with JWKS, JWT, OIDC, DPoP, public-key cryptography, and JWK thumbprints.

Also explained in

Compare how 3 books explain JSON Web Key →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.