Token Response Generator
Duende.IdentityServer.ResponseHandling.ITokenResponseGenerator
Section titled “Duende.IdentityServer.ResponseHandling.ITokenResponseGenerator”The ITokenResponseGenerator interface is the contract for the service that generates responses to valid requests to
the token endpoint. A response in this context refers to an object model that describes the content that will be
serialized and transmitted in the HTTP response.
The default implementation is the TokenResponseGenerator class. You can customize the behavior of the token endpoint
by providing your own implementation of the ITokenResponseGenerator to the ASP.NET Core service provider.
To create a customized implementation of ITokenResponseGenerator, we recommend that you create a class that derives
from the default implementation. Your custom implementation should override the appropriate virtual methods of the
default implementation and add your custom behavior to those overrides, possibly calling the base methods first and then
manipulating their results.
ITokenResponseGenerator
Section titled “ITokenResponseGenerator”The ITokenResponseGenerator contains a single method to process validated token requests and return token responses.
-
ProcessInteractionAsyncReturns the
TokenResponsebased on theValidatedTokenRequest.
TokenResponseGenerator
Section titled “TokenResponseGenerator”The default implementation of the ITokenResponseGenerator contains virtual methods that can be overridden to customize
particular behavior for particular token requests.
-
ProcessAsyncReturns the
TokenResponsefor anyTokenRequestValidationResult. -
ProcessClientCredentialsRequestAsyncReturns the
TokenResponsefor aTokenRequestValidationResultfrom the client credentials flow. -
ProcessPasswordRequestAsyncReturns the
TokenResponsefor aTokenRequestValidationResultfrom the resource owner password flow. -
ProcessAuthorizationCodeRequestAsyncReturns the
TokenResponsefor aTokenRequestValidationResultfrom the authorization code flow. -
ProcessRefreshTokenRequestAsyncReturns the
TokenResponsefor aTokenRequestValidationResultfrom the refresh token flow. -
ProcessDeviceCodeRequestAsyncReturns the
TokenResponsefor aTokenRequestValidationResultfrom the device code flow. -
ProcessCibaRequestAsyncReturns the
TokenResponsefor aTokenRequestValidationResultfrom the CIBA flow. -
ProcessExtensionGrantRequestAsyncReturns the
TokenResponsefor aTokenRequestValidationResultfrom an extension grant. -
CreateAccessTokenAsyncCreates an access token and optionally a refresh token.
-
CreateIdTokenFromRefreshTokenRequestAsyncCreates an ID token in a refresh token request.
TokenResponse
Section titled “TokenResponse”The TokenResponse class represents the data that will be included in the body of the response returned from the token
endpoint. It contains properties for the various tokens that can be returned, the scope and expiration of the access
token, and a mechanism for adding custom properties to the result. Omitting property values will cause the entire
property to be absent from the response.
-
IdentityTokenThe identity token.
-
AccessTokenThe access token.
-
RefreshTokenThe refresh token.
-
AccessTokenLifetimeThe access token lifetime in seconds.
-
ScopeThe scope.
-
CustomA dictionary of strings to objects that will be serialized to json and added to the token response.