Table of Contents

Class DefaultTokenService

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

Default token service

public class DefaultTokenService : ITokenService
Inheritance
DefaultTokenService
Implements
Inherited Members

Constructors

DefaultTokenService(IClaimsService, IReferenceTokenStore, ITokenCreationService, IClock, IKeyMaterialService, IdentityServerOptions, ILogger<DefaultTokenService>)

Initializes a new instance of the DefaultTokenService class.

public DefaultTokenService(IClaimsService claimsProvider, IReferenceTokenStore referenceTokenStore, ITokenCreationService creationService, IClock clock, IKeyMaterialService keyMaterialService, IdentityServerOptions options, ILogger<DefaultTokenService> logger)

Parameters

claimsProvider IClaimsService

The claims provider.

referenceTokenStore IReferenceTokenStore

The reference token store.

creationService ITokenCreationService

The signing service.

clock IClock

The clock.

keyMaterialService IKeyMaterialService
options IdentityServerOptions

The IdentityServer options

logger ILogger<DefaultTokenService>

The logger.

Fields

ClaimsProvider

The claims provider

protected readonly IClaimsService ClaimsProvider

Field Value

IClaimsService

Clock

The clock

protected readonly IClock Clock

Field Value

IClock

CreationService

The signing service

protected readonly ITokenCreationService CreationService

Field Value

ITokenCreationService

KeyMaterialService

The key material service

protected readonly IKeyMaterialService KeyMaterialService

Field Value

IKeyMaterialService

Logger

The logger

protected readonly ILogger Logger

Field Value

ILogger

Options

The IdentityServer options

protected readonly IdentityServerOptions Options

Field Value

IdentityServerOptions

ReferenceTokenStore

The reference token store

protected readonly IReferenceTokenStore ReferenceTokenStore

Field Value

IReferenceTokenStore

Methods

CreateAccessTokenAsync(TokenCreationRequest)

Creates an access token.

public virtual Task<Token> CreateAccessTokenAsync(TokenCreationRequest request)

Parameters

request TokenCreationRequest

The token creation request.

Returns

Task<Token>

An access token

CreateIdentityTokenAsync(TokenCreationRequest)

Creates an identity token.

public virtual Task<Token> CreateIdentityTokenAsync(TokenCreationRequest request)

Parameters

request TokenCreationRequest

The token creation request.

Returns

Task<Token>

An identity token

CreateSecurityTokenAsync(Token)

Creates a serialized and protected security token.

public virtual Task<string> CreateSecurityTokenAsync(Token token)

Parameters

token Token

The token.

Returns

Task<string>

A security token in serialized form

Exceptions

InvalidOperationException

Invalid token type.