Table of Contents

Class CaptchaServiceCollectionExtensions

Namespace
NuvTools.Security.AspNetCore.Extensions
Assembly
NuvTools.Security.AspNetCore.dll

Extension methods for registering the CAPTCHA verification services.

public static class CaptchaServiceCollectionExtensions
Inheritance
CaptchaServiceCollectionExtensions
Inherited Members

Methods

AddCaptcha(IServiceCollection, IConfiguration, int)

Binds CaptchaOptions from the SectionName section and registers ICaptchaVerifier with its own HttpClient.

public static IServiceCollection AddCaptcha(this IServiceCollection services, IConfiguration configuration, int timeoutInSeconds = 10)

Parameters

services IServiceCollection

The service collection to add the services to.

configuration IConfiguration

Configuration holding the CAPTCHA section.

timeoutInSeconds int

Timeout of the assessment call. Defaults to 10 seconds.

Returns

IServiceCollection

The service collection for chaining.

Remarks

The ValidateCaptchaAttribute is applied per endpoint — this method only wires up the services it depends on.