gnap-caep-client
    Preparing search index...

    Class TokenManager

    Caches GrantSets per key (typically one per signed-in person) and keeps their access tokens fresh by GNAP token rotation (RFC 9635 section 6.1).

    • getTokenSet(key) always returns a token valid for at least refreshSkewSec, rotating on demand.
    • With autoRefresh (default), a timer rotates each token refreshSkewSec before it expires.
    • Concurrent rotations for the same key are coalesced into one request; across tabs sharing a store, a rotation holds a Web Lock and reuses the token another tab has just obtained, so a management token is never presented twice.

    Events: "rotated" (key, grantSet) — a new access token obtained by rotation "rotation_error" (key, error) — rotation failed (tokens are dropped when the grant is gone) "expired" (key) — tokens for key could not be renewed and were removed "removed" (key) — tokens deleted via delete()

    Hierarchy (View Summary)

    Index
    • Removes the grant for key, optionally revoking it at the AS: the whole grant (section 5.4), or with revoke: 'token' only its access token (section 6.2).

      Parameters

      • key: string
      • Optionalopts: { revoke?: boolean | "token" | "grant" } = {}

      Returns Promise<GrantSet | undefined>