#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.JwtBearer](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.JwtBearer 'Abblix\.Oidc\.Server\.Features\.JwtBearer')

## IJwtReplayCache Interface

Legacy two\-step replay\-cache contract: a separate [IsReplayedAsync\(string\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache#Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache.IsReplayedAsync(string) 'Abblix\.Oidc\.Server\.Features\.JwtBearer\.IJwtReplayCache\.IsReplayedAsync\(string\)')
read followed by a [MarkAsUsedAsync\(string, Nullable&lt;DateTimeOffset&gt;\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache#Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache.MarkAsUsedAsync(string,System.Nullable_System.DateTimeOffset_) 'Abblix\.Oidc\.Server\.Features\.JwtBearer\.IJwtReplayCache\.MarkAsUsedAsync\(string, System\.Nullable\<System\.DateTimeOffset\>\)') write\. The shape leaks a
read\-then\-write race window to concurrent presenters of the same jti\.

```csharp
public interface IJwtReplayCache
```

Derived  
↳ [DistributedJwtReplayCache](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.JwtBearer.DistributedJwtReplayCache 'Abblix\.Oidc\.Server\.Features\.JwtBearer\.DistributedJwtReplayCache')

### Remarks
Replaced by [TryAddAsync\(string, Nullable&lt;DateTimeOffset&gt;\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ReplayPrevention.IJwtReplayCache#Abblix.Oidc.Server.Features.ReplayPrevention.IJwtReplayCache.TryAddAsync(string,System.Nullable_System.DateTimeOffset_) 'Abblix\.Oidc\.Server\.Features\.ReplayPrevention\.IJwtReplayCache\.TryAddAsync\(string, System\.Nullable\<System\.DateTimeOffset\>\)'), whose
single\-call shape lets atomic\-capable backends close the race natively\. This
interface remains as a backward\-compat alias so host code that DI\-resolves the
legacy type still receives a working instance during the transition window\.
### Methods

## IJwtReplayCache\.IsReplayedAsync\(string\) Method {#Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache.IsReplayedAsync(string)}

Checks if a JWT with the specified JTI has already been used\.

```csharp
System.Threading.Tasks.Task<bool> IsReplayedAsync(string jti);
```
#### Parameters

###### `jti` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache.IsReplayedAsync(string).jti}

The JWT ID \(jti claim\) to check\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that completes with true if the JWT has already been used \(replay detected\);
false if this is the first time the JWT is being presented\.

## IJwtReplayCache\.MarkAsUsedAsync\(string, Nullable\<DateTimeOffset\>\) Method {#Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache.MarkAsUsedAsync(string,System.Nullable_System.DateTimeOffset_)}

Marks a JWT as used by storing its JTI in the cache until the specified expiration time\.

```csharp
System.Threading.Tasks.Task MarkAsUsedAsync(string jti, System.Nullable<System.DateTimeOffset> expiresAt);
```
#### Parameters

###### `jti` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache.MarkAsUsedAsync(string,System.Nullable_System.DateTimeOffset_).jti}

The JWT ID \(jti claim\) to mark as used\.

###### `expiresAt` [System\.Nullable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')[System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1') {#Abblix.Oidc.Server.Features.JwtBearer.IJwtReplayCache.MarkAsUsedAsync(string,System.Nullable_System.DateTimeOffset_).expiresAt}

The time at which the JWT expires\. The JTI will be stored until this time plus a small buffer\.
If null, a default expiration will be used\.

#### Returns
[System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task')  
A task that completes when the JTI has been stored\.
