Skip to content

ReplayIdentifier Class

Composes what a receiver reserves in IReplayCache for one token.

C#
public static class ReplayIdentifier

Inheritance System.Object → ReplayIdentifier

Remarks

Every receiver in this package answers the same question of the cache and must answer it the same way, which is why the composition lives here rather than at each call site. Two receivers deriving one rule separately do not fail on the day they disagree - they keep working, in different key spaces, and the disagreement surfaces only when somebody tightens one of them.

Methods

ReplayIdentifier.ForToken(string, string) Method

Composes the identifier for a token, scoping its own identifier to its issuer.

C#
public static string ForToken(string issuer, string tokenId);

Parameters

issuer System.String

The iss claim of the token.

tokenId System.String

The jti claim of the token.

Returns

System.String
The value to reserve.

Remarks

The issuer belongs in the value because a jti is unique only "within a particular event feed" (RFC 8417 Section 2.2), so reserving the identifier alone would let one provider's token refuse another provider's. Escaping removes the separator from both halves, so two distinct pairs cannot compose onto one identifier - without it an issuer ending in the separator and a short identifier produce the same value as a shorter issuer and a longer identifier, and one provider could reserve another's.