Skip to content

PATTERN Cited by 1 source

Scoped token per operation

Problem

In a pub/sub system, a single shared credential for both publishers and subscribers allows credential misuse — a viewer could impersonate a broadcaster by using the same credential to publish.

Solution

Issue separate tokens per operation class (publish, subscribe, or both) on a given resource, each with its own expiration and revocability. The relay checks the token at session open and enforces what operations that token permits.

Consequences

  • Role separation — publisher and subscriber roles are cryptographically distinct.
  • Independent revocation — disabling one token doesn't disrupt other clients.
  • Flexible granularity — can issue time-limited tokens for specific audiences (e.g., a "viewers" token expiring at midnight).
  • URL-embedded — in MoQ, the token travels in the URL path, simplifying client integration.

Seen in

Last updated · 606 distilled / 1,847 read