Skip to main content

ClientSecretGenerator Class

Abblix.Oidc.Server

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.

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

Inheritance System.Object → ClientSecretGenerator

Implements IClientSecretGenerator

Methods

ClientSecretGenerator.GenerateClientSecret(int) Method

Generates a client secret string with the specified length.

public string GenerateClientSecret(int length);

Parameters

length System.Int32

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)

Returns

System.String
A client secret string of the specified length.