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

## IClientJwtFormatter Interface

Serializes a JWT addressed to a specific client \(ID Token, Logout Token, etc\.\) into compact
form: signed as a JWS \(RFC 7515\) with the server's signing key chosen by the JWT's header
algorithm, then optionally wrapped in a JWE \(RFC 7516\) encrypted to the client's registered
public key per the client's `id_token_encrypted_response_alg`/`_enc` metadata\.

```csharp
public interface IClientJwtFormatter
```

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

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

Formats a JWT for a client, inferring the encryption metadata from the token's header `typ`\.

```csharp
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.IClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).token}

The JWT token to format\.

###### `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.IClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).clientInfo}

The client information\.

#### 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')  
The formatted JWT string\.

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

Formats a JWT for a 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.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).encryption 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.IClientJwtFormatter\.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
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.IClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption).token}

The JWT token to format\.

###### `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.IClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption).clientInfo}

The client information\.

###### `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.IClientJwtFormatter.FormatAsync(Abblix.Jwt.JsonWebToken,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.Tokens.Formatters.ClientJwtEncryption).encryption}

The encryption policy governing whether and how the JWT is encrypted\.

#### 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')  
The formatted JWT string\.
