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

## LogoutTokenService Class

Implements the [ILogoutTokenService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.ILogoutTokenService 'Abblix\.Oidc\.Server\.Features\.Tokens\.ILogoutTokenService') interface to generate logout tokens\.

```csharp
public class LogoutTokenService : Abblix.Oidc.Server.Features.Tokens.ILogoutTokenService
```

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

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

## LogoutTokenService\(ILogger\<LogoutTokenService\>, TimeProvider, ISubjectTypeConverter, IClientJwtFormatter, ITokenIdGenerator, IOptions\<OidcOptions\>\) Constructor {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.LogoutTokenService(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.LogoutTokenService_,System.TimeProvider,Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter,Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter,Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_)}

Implements the [ILogoutTokenService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.ILogoutTokenService 'Abblix\.Oidc\.Server\.Features\.Tokens\.ILogoutTokenService') interface to generate logout tokens\.

```csharp
public LogoutTokenService(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Features.Tokens.LogoutTokenService> logger, System.TimeProvider clock, Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter subjectTypeConverter, Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter jwtFormatter, Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator tokenIdGenerator, Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options);
```
#### Parameters

###### `logger` [Microsoft\.Extensions\.Logging\.ILogger&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1')[LogoutTokenService](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.LogoutTokenService 'Abblix\.Oidc\.Server\.Features\.Tokens\.LogoutTokenService')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1') {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.LogoutTokenService(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.LogoutTokenService_,System.TimeProvider,Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter,Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter,Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).logger}

Logger for logging operations related to logout token generation\.

###### `clock` [System\.TimeProvider](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider 'System\.TimeProvider') {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.LogoutTokenService(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.LogoutTokenService_,System.TimeProvider,Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter,Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter,Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).clock}

Clock used for setting token validity timestamps\.

###### `subjectTypeConverter` [ISubjectTypeConverter](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter 'Abblix\.Oidc\.Server\.Features\.UserInfo\.ISubjectTypeConverter') {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.LogoutTokenService(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.LogoutTokenService_,System.TimeProvider,Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter,Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter,Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).subjectTypeConverter}

Converter for transforming subject identifiers based on client configurations\.

###### `jwtFormatter` [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') {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.LogoutTokenService(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.LogoutTokenService_,System.TimeProvider,Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter,Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter,Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).jwtFormatter}

Formatter for encoding the generated logout token into a compact serialized format\.

###### `tokenIdGenerator` [ITokenIdGenerator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator 'Abblix\.Oidc\.Server\.Features\.RandomGenerators\.ITokenIdGenerator') {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.LogoutTokenService(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.LogoutTokenService_,System.TimeProvider,Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter,Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter,Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).tokenIdGenerator}

Generator for creating unique JWT identifiers\.

###### `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.LogoutTokenService.LogoutTokenService(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.Tokens.LogoutTokenService_,System.TimeProvider,Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter,Abblix.Oidc.Server.Features.Tokens.Formatters.IClientJwtFormatter,Abblix.Oidc.Server.Features.RandomGenerators.ITokenIdGenerator,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).options}

Supplies the default content\-encryption algorithm used when the client registered a
            key\-management algorithm but no `id_token_encrypted_response_enc`\.
### Methods

## LogoutTokenService\.CreateLogoutTokenAsync\(ClientInfo, LogoutContext\) Method {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.CreateLogoutTokenAsync(Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.LogoutNotification.LogoutContext)}

Asynchronously creates a logout token based on the provided client information and logout event context\.
The token is then encoded to a serialized string format for easy distribution to clients\.

```csharp
public System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.Tokens.EncodedJsonWebToken> CreateLogoutTokenAsync(Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo, Abblix.Oidc.Server.Features.LogoutNotification.LogoutContext logoutContext);
```
#### Parameters

###### `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.LogoutTokenService.CreateLogoutTokenAsync(Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.LogoutNotification.LogoutContext).clientInfo}

Information about the client that will receive the logout token\.

###### `logoutContext` [LogoutContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.LogoutNotification.LogoutContext 'Abblix\.Oidc\.Server\.Features\.LogoutNotification\.LogoutContext') {#Abblix.Oidc.Server.Features.Tokens.LogoutTokenService.CreateLogoutTokenAsync(Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.LogoutNotification.LogoutContext).logoutContext}

Contextual information about the logout event, including the user's subject ID
            and session ID\.

Implements [CreateLogoutTokenAsync\(ClientInfo, LogoutContext\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.ILogoutTokenService#Abblix.Oidc.Server.Features.Tokens.ILogoutTokenService.CreateLogoutTokenAsync(Abblix.Oidc.Server.Features.ClientInformation.ClientInfo,Abblix.Oidc.Server.Features.LogoutNotification.LogoutContext) 'Abblix\.Oidc\.Server\.Features\.Tokens\.ILogoutTokenService\.CreateLogoutTokenAsync\(Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo, Abblix\.Oidc\.Server\.Features\.LogoutNotification\.LogoutContext\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[EncodedJsonWebToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.EncodedJsonWebToken 'Abblix\.Oidc\.Server\.Features\.Tokens\.EncodedJsonWebToken')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns a logout token\.
            The task result is an [EncodedJsonWebToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.EncodedJsonWebToken 'Abblix\.Oidc\.Server\.Features\.Tokens\.EncodedJsonWebToken'), which includes both the raw token object and its
            string representation\.
