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

## ServiceCollectionExtensions Class

Wires replay protection, which several unrelated features need and none of them owns:
JWT\-bearer assertions \(RFC 7523 Section 3\), client assertions, and DPoP proofs
\(RFC 9449 Section 11\.1\) all reserve identifiers in the same place\.

```csharp
public static class ServiceCollectionExtensions
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ServiceCollectionExtensions
### Methods

## ServiceCollectionExtensions\.AddReplayPrevention\(this IServiceCollection\) Method {#Abblix.Oidc.Server.Features.ReplayPrevention.ServiceCollectionExtensions.AddReplayPrevention(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection)}

Registers the replay cache and the deprecated contract that still resolves to it\.

```csharp
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddReplayPrevention(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
```
#### Parameters

###### `services` [Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection') {#Abblix.Oidc.Server.Features.ReplayPrevention.ServiceCollectionExtensions.AddReplayPrevention(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection).services}

The service collection\.

#### Returns
[Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection')

### Remarks
Idempotent and TryAdd throughout, because three unrelated feature registrations call it
and a host may have decided any part of it beforehand\.
