#### [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')

## ClientSecretGenerator Class

Provides a mechanism for securely generating client secret strings used in OAuth 2\.0 and OpenID Connect authentication flows\.
This implementation uses a cryptographic random number generator to produce a high\-entropy secret string,
which is crucial for maintaining the security and integrity of client authentication\.
The generated secret is encoded in a URL\-safe Base32 format and trimmed to the specified length\.

```csharp
public class ClientSecretGenerator : Abblix.Oidc.Server.Features.RandomGenerators.IClientSecretGenerator
```

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

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

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

Generates a client secret string with the specified length\.

```csharp
public 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.ClientSecretGenerator.GenerateClientSecret(int).length}

The length of the client secret to generate\.
            The actual length of the generated secret might be slightly longer to ensure proper encoding
            and then trimmed to the desired length\.

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

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
A client secret string of the specified length\.
