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

## IAuthorizationValueReuseDetector Interface

Detects reuse of an authorization request's transaction\-binding values — the PKCE
`code_challenge` \(RFC 7636\) and the OpenID Connect `nonce`\. Both must be
transaction\-specific; a client that keeps sending a constant value defeats the protection they provide\.
RFC 9700 \(OAuth 2\.0 Security BCP\) Section 2\.1\.1 encourages the authorization server to make a
reasonable effort to detect and prevent this\. Detection is off unless
[PkceAndNonceReuseDetectionInterval](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions#Abblix.Oidc.Server.Common.Configuration.OidcOptions.PkceAndNonceReuseDetectionInterval 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions\.PkceAndNonceReuseDetectionInterval') is set\.

```csharp
public interface IAuthorizationValueReuseDetector
```

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

## IAuthorizationValueReuseDetector\.IsReusedAsync\(string, string, string\) Method {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.IsReusedAsync(string,string,string)}

Reports whether a value of the given kind has already been recorded for this client within the
detection window — that is, whether the client is repeating a value that must be unique per request\.

```csharp
System.Threading.Tasks.Task<bool> IsReusedAsync(string clientId, string valueKind, string value);
```
#### Parameters

###### `clientId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.IsReusedAsync(string,string,string).clientId}

The client presenting the value\.

###### `valueKind` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.IsReusedAsync(string,string,string).valueKind}

A discriminator for the value's role \(for example the parameter name\), so
            a `code_challenge` and a `nonce` that happen to coincide are tracked separately\.

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.IsReusedAsync(string,string,string).value}

The raw value; only a hash of it is ever stored\.

#### 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')  
`true` when the value was seen before within the window; otherwise `false`\.
            Always `false` when detection is disabled\.

## IAuthorizationValueReuseDetector\.RecordAsync\(string, string, string\) Method {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.RecordAsync(string,string,string)}

Records a value as used by this client so a later reuse within the detection window is caught\.
A no\-op when detection is disabled\. Called once per issued authorization code, not on every
authorization request, so re\-processing one request across a login or consent redirect is not flagged\.

```csharp
System.Threading.Tasks.Task RecordAsync(string clientId, string valueKind, string value);
```
#### Parameters

###### `clientId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.RecordAsync(string,string,string).clientId}

###### `valueKind` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.RecordAsync(string,string,string).valueKind}

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector.RecordAsync(string,string,string).value}

#### Returns
[System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task')
