Class ValidateCaptchaFilter
- Namespace
- NuvTools.Security.AspNetCore.Captcha
- Assembly
- NuvTools.Security.AspNetCore.dll
Adaptive CAPTCHA action filter (reCAPTCHA Enterprise).
public sealed class ValidateCaptchaFilter : IAsyncActionFilter, IFilterMetadata
- Inheritance
-
ValidateCaptchaFilter
- Implements
- Inherited Members
Remarks
Default flow: the client sends a score token (invisible) in TokenHeader with ModeHeader set to ModeScore. If the score falls below MinScore, the filter answers asking for a step-up (StepUpMarker) and the client resubmits with the checkbox token (ModeCheckbox). Verification is skipped when the CAPTCHA is disabled.
Constructors
ValidateCaptchaFilter(ICaptchaVerifier, IOptions<CaptchaOptions>)
Adaptive CAPTCHA action filter (reCAPTCHA Enterprise).
public ValidateCaptchaFilter(ICaptchaVerifier verifier, IOptions<CaptchaOptions> options)
Parameters
verifierICaptchaVerifierVerifier that creates the assessment against the provider.
optionsIOptions<CaptchaOptions>CAPTCHA configuration.
Remarks
Default flow: the client sends a score token (invisible) in TokenHeader with ModeHeader set to ModeScore. If the score falls below MinScore, the filter answers asking for a step-up (StepUpMarker) and the client resubmits with the checkbox token (ModeCheckbox). Verification is skipped when the CAPTCHA is disabled.
Methods
OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)
Called asynchronously before the action, after model binding is complete.
public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
Parameters
contextActionExecutingContextnextActionExecutionDelegateThe ActionExecutionDelegate. Invoked to execute the next action filter or the action itself.