Table of Contents

Class TokenEndpoint

Namespace
Fdyay.IdentityServer.Endpoints
Assembly
Fdyay.IdentityServer.AspNetCore.dll

The OAuth 2.0 token endpoint.

public sealed class TokenEndpoint : IEndpointHandler
Inheritance
TokenEndpoint
Implements
Inherited Members

Constructors

TokenEndpoint(IClientSecretValidator, ISecretsListParser, ITokenRequestValidator, ITokenResponseGenerator, IIssuerNameService, IDPoPProofValidator, IOptions<IdentityServerOptions>, ILogger<TokenEndpoint>, IEventService, ICustomTokenRequestValidator)

Creates the endpoint from its services, without the refresh token service.

public TokenEndpoint(IClientSecretValidator clientValidator, ISecretsListParser secretParser, ITokenRequestValidator requestValidator, ITokenResponseGenerator responseGenerator, IIssuerNameService issuerNameService, IDPoPProofValidator dpop, IOptions<IdentityServerOptions> options, ILogger<TokenEndpoint> logger, IEventService events, ICustomTokenRequestValidator customValidator)

Parameters

clientValidator IClientSecretValidator

Authenticates the client from the credential it presented.

secretParser ISecretsListParser

Reads the client's credential from the request.

requestValidator ITokenRequestValidator

Validates the token request for its grant type.

responseGenerator ITokenResponseGenerator

Issues the tokens for a validated request.

issuerNameService IIssuerNameService

Names this server as the issuer of the tokens.

dpop IDPoPProofValidator

Validates the request's DPoP proof (RFC 9449).

options IOptions<IdentityServerOptions>

The server options: the DPoP proof length limit and when a mutual-TLS confirmation is issued.

logger ILogger<TokenEndpoint>

Receives the endpoint's diagnostics.

events IEventService

Receives the endpoint's success and failure events.

customValidator ICustomTokenRequestValidator

The host's extra validation, run after the built-in validation succeeds.

Remarks

The constructor this had before 0.176.0, kept: with no refresh token service, a refresh token is not taken before it is answered with tokens, as before. The container builds the one below.

TokenEndpoint(IClientSecretValidator, ISecretsListParser, ITokenRequestValidator, ITokenResponseGenerator, IIssuerNameService, IDPoPProofValidator, IOptions<IdentityServerOptions>, ILogger<TokenEndpoint>, IEventService, ICustomTokenRequestValidator, IRefreshTokenService?)

Creates the endpoint from its services, as the container resolves it.

public TokenEndpoint(IClientSecretValidator clientValidator, ISecretsListParser secretParser, ITokenRequestValidator requestValidator, ITokenResponseGenerator responseGenerator, IIssuerNameService issuerNameService, IDPoPProofValidator dpop, IOptions<IdentityServerOptions> options, ILogger<TokenEndpoint> logger, IEventService events, ICustomTokenRequestValidator customValidator, IRefreshTokenService? refreshTokens)

Parameters

clientValidator IClientSecretValidator

Authenticates the client from the credential it presented.

secretParser ISecretsListParser

Reads the client's credential from the request.

requestValidator ITokenRequestValidator

Validates the token request for its grant type.

responseGenerator ITokenResponseGenerator

Issues the tokens for a validated request.

issuerNameService IIssuerNameService

Names this server as the issuer of the tokens.

dpop IDPoPProofValidator

Validates the request's DPoP proof (RFC 9449).

options IOptions<IdentityServerOptions>

The server options: the DPoP proof length limit and when a mutual-TLS confirmation is issued.

logger ILogger<TokenEndpoint>

Receives the endpoint's diagnostics.

events IEventService

Receives the endpoint's success and failure events.

customValidator ICustomTokenRequestValidator

The host's extra validation, run after the built-in validation succeeds.

refreshTokens IRefreshTokenService

Takes a refresh token for the request once every check has passed (TryRedeemAsync(string, RefreshToken, Client, CancellationToken)), so of two requests presenting one token only one is answered. New in 0.176.0.

Methods

ProcessAsync(HttpContext)

Processes the request, or returns null to pass the request through.

public Task<IEndpointResult?> ProcessAsync(HttpContext context)

Parameters

context HttpContext

Returns

Task<IEndpointResult>