Version 6.x has been out of support since May 14, 2024, and this corresponding section of the documentation is no longer maintained. We strongly recommend you upgrade to the latest supported version of 7.x and read the latest version of this documentation.

Custom Authorize Request Validator

Duende.IdentityServer.Validation.ICustomAuthorizeRequestValidator

Allows running custom code as part of the authorization issuance pipeline at the authorization endpoint.

/// <summary>
/// Allows inserting custom validation logic into authorize requests
/// </summary>
public interface ICustomAuthorizeRequestValidator
{
    /// <summary>
    /// Custom validation logic for the authorize request.
    /// </summary>
    /// <param name="context">The context.</param>
    Task ValidateAsync(CustomAuthorizeRequestValidationContext context);
}
  • ValidateAsync

    This method gets called during authorize request processing. The context gives you access to request and response parameters.

    To fail the request, set the the IsError, the Error, and optionally the ErrorDescription properties on the Result object on the CustomAuthorizeRequestValidationContext.