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
clientValidatorIClientSecretValidatorAuthenticates the client from the credential it presented.
secretParserISecretsListParserReads the client's credential from the request.
requestValidatorITokenRequestValidatorValidates the token request for its grant type.
responseGeneratorITokenResponseGeneratorIssues the tokens for a validated request.
issuerNameServiceIIssuerNameServiceNames this server as the issuer of the tokens.
dpopIDPoPProofValidatorValidates the request's DPoP proof (RFC 9449).
optionsIOptions<IdentityServerOptions>The server options: the DPoP proof length limit and when a mutual-TLS confirmation is issued.
loggerILogger<TokenEndpoint>Receives the endpoint's diagnostics.
eventsIEventServiceReceives the endpoint's success and failure events.
customValidatorICustomTokenRequestValidatorThe 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
clientValidatorIClientSecretValidatorAuthenticates the client from the credential it presented.
secretParserISecretsListParserReads the client's credential from the request.
requestValidatorITokenRequestValidatorValidates the token request for its grant type.
responseGeneratorITokenResponseGeneratorIssues the tokens for a validated request.
issuerNameServiceIIssuerNameServiceNames this server as the issuer of the tokens.
dpopIDPoPProofValidatorValidates the request's DPoP proof (RFC 9449).
optionsIOptions<IdentityServerOptions>The server options: the DPoP proof length limit and when a mutual-TLS confirmation is issued.
loggerILogger<TokenEndpoint>Receives the endpoint's diagnostics.
eventsIEventServiceReceives the endpoint's success and failure events.
customValidatorICustomTokenRequestValidatorThe host's extra validation, run after the built-in validation succeeds.
refreshTokensIRefreshTokenServiceTakes 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
contextHttpContext