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
servicesIServiceCollectionThe service collection to add the services to.
configurationIConfigurationConfiguration holding the CAPTCHA section.
timeoutInSecondsintTimeout 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.