Skip to content

IClientSecretEncryptor Interface

Encrypts the client secret a tenant issues on dynamic registration and decrypts it again: for the client configuration endpoint to return it when the client reads its registration (RFC 7592 section 3: the server "MUST return all registered metadata about this client", and Appendix A.1: "The client's current registration access token and client credentials (if applicable) MUST be included in the client information response"), and for the keys read from the secret of a client_secret_jwt client (Abblix.Oidc.Server.Features.ClientInformation.ClientSecretValues).

C#
public interface IClientSecretEncryptor

Remarks

Each tenant encrypts with the key of its own ClientSecretEncryption, and the value is bound to the tenant and the client, so it decrypts for no other client and in no other tenant. The key is required of every tenant while the server serves dynamic client registration.

Methods

IClientSecretEncryptor.Decrypt(TenantDefinition, string, byte[]) Method

The secret encryptedSecret holds for the client clientId of tenant, or null when it does not decrypt there: the tenant has no key, has replaced the one it was encrypted with or its hash algorithm, or the value was encrypted for another client.

C#
string? Decrypt(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant, string clientId, byte[] encryptedSecret);

Parameters

tenant TenantDefinition

The tenant the client is registered at.

clientId System.String

The client the secret was issued to.

encryptedSecret System.Byte[]

The value Encrypt(TenantDefinition, string, string) returned.

Returns

System.String

IClientSecretEncryptor.Encrypt(TenantDefinition, string, string) Method

secret, issued to the client clientId of tenant, encrypted for that client.

C#
byte[] Encrypt(Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant, string clientId, string secret);

Parameters

tenant TenantDefinition

The tenant the client is registered at.

clientId System.String

The client the secret is issued to.

secret System.String

The secret issued.

Returns

System.Byte[]

Exceptions

System.InvalidOperationException
The tenant has no key, which the check of the tenant list refuses before the tenant is served while the server serves dynamic client registration.