Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface Duende.​IdentityServer.​Services.​ITokenCreationService

Assembly: Duende.IdentityServer

Responsible for serializing a <see cref="T:Duende.IdentityServer.Models.Token" /> model into a signed and protected JWT string. The default implementation is <c>DefaultTokenCreationService</c> . This is the lowest-level token creation hook; prefer <see cref="T:Duende.IdentityServer.Services.IProfileService" /> , <c>IClaimsService</c> , or <see cref="T:Duende.IdentityServer.Services.ITokenService" /> for adding or modifying claims, and only implement this interface when those extension points are insufficient. If customization is needed, derive from <c>DefaultTokenCreationService</c> and override <c>CreatePayloadAsync</c> rather than implementing this interface from scratch.

Methods

CreateTokenAsync​(Models.​Token token, System.​Threading.​CancellationToken ct)
Converts the given <see cref="T:Duende.IdentityServer.Models.Token" /> model into a signed and serialized JWT string. This is the final step in token creation and provides a last opportunity to modify the token's payload (e.g. add audiences or claims) before it is signed.
Returns A compact, signed JWT string ready to be returned to the client.
token The token model describing the claims, lifetime, and signing key to use.
ct The cancellation token.