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

## IClientSecretGenerator Interface

Defines an interface responsible for generating secure client secrets for OpenID Connect \(OIDC\) clients\.
Client secrets are used as credentials for client authentication to the OIDC provider or authorization server\.

```csharp
public interface IClientSecretGenerator
```

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

## IClientSecretGenerator\.GenerateClientSecret\(int\) Method {#Abblix.Oidc.Server.Features.RandomGenerators.IClientSecretGenerator.GenerateClientSecret(int)}

Generates a new, secure client secret string of the specified length\. The generated secret is intended
for use by confidential clients in OAuth 2\.0 and OpenID Connect authentication flows\. It is crucial
that the generated secret is of sufficient length and randomness to ensure the security of client
authentication processes\.

```csharp
string GenerateClientSecret(int length);
```
#### Parameters

###### `length` [System\.Int32](https://learn.microsoft.com/en-us/dotnet/api/system.int32 'System\.Int32') {#Abblix.Oidc.Server.Features.RandomGenerators.IClientSecretGenerator.GenerateClientSecret(int).length}

The desired length of the client secret\. It is recommended that secrets be of
            sufficient length \(e\.g\., at least 32 characters\) to ensure adequate security against brute\-force
            or guessing attacks\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
A securely generated client secret string of the specified length\. The secret should consist
            of a cryptographically strong, random sequence of characters that can include a mix of letters,
            digits, and special characters\.
