Auth & HTTP

JWTs and bearer authorization

Follow a bearer token from the Angular app to API verification.

Back to learning paths
AUTH & HTTP / REQUEST PATH
Lesson flow Angular app. API server. Token verifier. Bearer token. Angular appAPI serverToken verifierBearer token

REQUEST · SYNTHETIC LESSON DATA

Event log

  1. Send the bearer token

Objective

Separate signature verification, access-token claim validation, and scope-based authorization.

Transcript

Angular 22.3.2

  1. The fixture creates a signed access token with a header, claims, and signature. The JSON portions can be decoded without proving integrity.
  2. The simulated client presents a redacted bearer token. Web Crypto verifies the real fixture signature using an ephemeral key and a fixed algorithm.
  3. The API checks the issuer, audience, and expiry. A token for the wrong audience or an expired token receives 401 in this fixture.
  4. A token that passes validation still needs the resource scope. The scenario allows a catalog read and rejects a write with 403.
  5. These tokens and keys exist only for this fixture and are never sent over the network.

Sources