liveBook · Manning

Digital signature

As explained in Secure APIs

A token signature is cryptographic data that allows a recipient to verify that a token was issued by a trusted party and has not been altered.

A digital signature is cryptographic data attached to a token. It lets an API verify that a trusted party issued the token and that its contents have not been altered. In a JWT, the header contains metadata, the payload contains claims, and the signature proves legitimacy. section 7.8 section 1.4

Treat signature validation as a critical authentication check:

  • Use strong signing algorithms and validate the signature on every token. section 1.4
  • Reject unsigned tokens and tokens whose signatures do not validate; otherwise attackers can alter claims, hijack accounts, or escalate privileges. section 4.4
  • Test token validation explicitly, including forged, unsigned, and expired tokens. section 4.4

Forged access token

An API accepts a JWT after checking its claims but fails to validate its signature. An attacker can modify those claims to impersonate another user or obtain higher privileges. Accepting an unsigned token creates the same kind of authentication failure. section 4.4

How Secure APIs covers it

How deep it goes
Defines the JWT signature and stresses validation, but defers signing implementation details.
Examples
Uses forged, tampered, unsigned, and expired access tokens to illustrate authentication failures.
What it assumes
Assumes familiarity with API access tokens and introduces JWT headers, payloads, claims, and signatures.
What you can do after
Diagnose token-validation failures that enable impersonation or privilege escalation.
How it connects
Connects digital signatures to JWT, access tokens, authentication, authorization, OAuth, and privilege escalation.

Also explained in

Compare how 8 books explain digital signature →

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.