Table of Contents

Class DefaultTokenCreationService

Namespace
Duende.IdentityServer.Services
Assembly
Duende.IdentityServer.dll

Default token creation service

public class DefaultTokenCreationService : ITokenCreationService
Inheritance
DefaultTokenCreationService
Implements
Inherited Members

Constructors

DefaultTokenCreationService(IClock, IKeyMaterialService, IdentityServerOptions, ILogger<DefaultTokenCreationService>)

Initializes a new instance of the DefaultTokenCreationService class.

public DefaultTokenCreationService(IClock clock, IKeyMaterialService keys, IdentityServerOptions options, ILogger<DefaultTokenCreationService> logger)

Parameters

clock IClock

The options.

keys IKeyMaterialService

The keys.

options IdentityServerOptions

The options.

logger ILogger<DefaultTokenCreationService>

The logger.

Fields

Clock

The clock

protected readonly IClock Clock

Field Value

IClock

Keys

The key service

protected readonly IKeyMaterialService Keys

Field Value

IKeyMaterialService

Logger

The logger

protected readonly ILogger Logger

Field Value

ILogger

Options

The options

protected readonly IdentityServerOptions Options

Field Value

IdentityServerOptions

Methods

CreateHeaderElementsAsync(Token)

Creates additional JWT header elements

protected virtual Task<Dictionary<string, object>> CreateHeaderElementsAsync(Token token)

Parameters

token Token

Returns

Task<Dictionary<string, object>>

CreateJwtAsync(Token, string, Dictionary<string, object>)

Creates JWT token

protected virtual Task<string> CreateJwtAsync(Token token, string payload, Dictionary<string, object> headerElements)

Parameters

token Token
payload string
headerElements Dictionary<string, object>

Returns

Task<string>

Exceptions

InvalidOperationException

CreatePayloadAsync(Token)

Creates the JWT payload

protected virtual Task<string> CreatePayloadAsync(Token token)

Parameters

token Token

Returns

Task<string>

CreateTokenAsync(Token)

Creates the token.

public virtual Task<string> CreateTokenAsync(Token token)

Parameters

token Token

The token.

Returns

Task<string>

A protected and serialized security token