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

## ClientJwtFormatter Class

Provides functionality to format JSON Web Tokens \(JWTs\) issued to clients by the authentication service\.
This class handles the signing of JWTs and, if configured, their encryption, based on the needs of each client\.

```csharp
public class ClientJwtFormatter : Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter
```

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

Implements [IClientJwtFormatter](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.IClientJwtFormatter')
### Constructors

## ClientJwtFormatter\(IJsonWebTokenCreator, IClientKeysProvider, IAuthServiceKeysProvider, IOptions\<OidcOptions\>\) Constructor {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.ClientJwtFormatter(Abblix.Jwt.IJsonWebTokenCreator,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_)}

Provides functionality to format JSON Web Tokens \(JWTs\) issued to clients by the authentication service\.
This class handles the signing of JWTs and, if configured, their encryption, based on the needs of each client\.

```csharp
public ClientJwtFormatter(Abblix.Jwt.IJsonWebTokenCreator jwtCreator, Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider clientKeysProvider, Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider serviceKeysProvider, Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options);
```
#### Parameters

###### `jwtCreator` [IJsonWebTokenCreator](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.IJsonWebTokenCreator 'Abblix\.Jwt\.IJsonWebTokenCreator') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.ClientJwtFormatter(Abblix.Jwt.IJsonWebTokenCreator,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).jwtCreator}

Creator for issuing JWTs\.

###### `clientKeysProvider` [IClientKeysProvider](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.IClientKeysProvider') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.ClientJwtFormatter(Abblix.Jwt.IJsonWebTokenCreator,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).clientKeysProvider}

Provider for client encryption keys\.

###### `serviceKeysProvider` [IAuthServiceKeysProvider](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IAuthServiceKeysProvider') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.ClientJwtFormatter(Abblix.Jwt.IJsonWebTokenCreator,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).serviceKeysProvider}

Provider for service signing keys\.

###### `options` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.ClientJwtFormatter(Abblix.Jwt.IJsonWebTokenCreator,Abblix.Oidc.Server.Features.ClientInformation.IClientKeysProvider,Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).options}

OIDC configuration options\.
### Methods

## ClientJwtFormatter\.FormatAsync\(JsonWebToken, ClientInfo\) Method {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo)}

Asynchronously formats a JWT for a specific client, inferring the encryption metadata from the token's
header `typ` \(id\_token/logout\_token vs\. UserInfo\)\.

```csharp
public System.Threading.Tasks.Task<string> FormatAsync(Abblix.Jwt.JsonWebToken token, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo);
```
#### Parameters

###### `token` [JsonWebToken](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebToken 'Abblix\.Jwt\.JsonWebToken') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).token}

The JSON Web Token \(JWT\) to be formatted for the client\.

###### `clientInfo` [ClientInfo](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.ClientInfo 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).clientInfo}

Information about the client to which the JWT is issued, including any requirements for encryption\.

Implements [FormatAsync\(JsonWebToken, ClientInfo\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter#Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo) 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.IClientJwtFormatter\.FormatAsync\(Abblix\.Jwt\.JsonWebToken, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo\)')

#### 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\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns a JWT string formatted and ready for use by the client\.

## ClientJwtFormatter\.FormatAsync\(JsonWebToken, ClientInfo, ClientJwtEncryption\) Method {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption)}

Asynchronously formats a JWT for a specific client, signing it with the authentication service's key chosen by
the token's header algorithm and — per the supplied [encryption](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption).encryption 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientJwtFormatter\.FormatAsync\(Abblix\.Jwt\.JsonWebToken, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo, Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientJwtEncryption\)\.encryption') policy — optionally
encrypting it to the client's registered public key\.

```csharp
public System.Threading.Tasks.Task<string> FormatAsync(Abblix.Jwt.JsonWebToken token, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo, Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption encryption);
```
#### Parameters

###### `token` [JsonWebToken](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebToken 'Abblix\.Jwt\.JsonWebToken') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption).token}

The JSON Web Token \(JWT\) to be formatted for the client\.

###### `clientInfo` [ClientInfo](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.ClientInfo 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption).clientInfo}

Information about the client to which the JWT is issued\.

###### `encryption` [ClientJwtEncryption](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientJwtEncryption') {#Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption).encryption}

The encryption policy: which registered client metadata governs encryption, the
            content\-encryption default, and whether encryption requires a registered key\-management algorithm\.

Implements [FormatAsync\(JsonWebToken, ClientInfo, ClientJwtEncryption\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter#Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption) 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.IClientJwtFormatter\.FormatAsync\(Abblix\.Jwt\.JsonWebToken, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo, Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ClientJwtEncryption\)')

#### 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\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns a JWT string formatted and ready for use by the client\.
