ApricotFramework.Captcha
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.Captcha --version 0.1.0
NuGet\Install-Package ApricotFramework.Captcha -Version 0.1.0
<PackageReference Include="ApricotFramework.Captcha" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.Captcha" Version="0.1.0" />
<PackageReference Include="ApricotFramework.Captcha" />
paket add ApricotFramework.Captcha --version 0.1.0
#r "nuget: ApricotFramework.Captcha, 0.1.0"
#:package ApricotFramework.Captcha@0.1.0
#addin nuget:?package=ApricotFramework.Captcha&version=0.1.0
#tool nuget:?package=ApricotFramework.Captcha&version=0.1.0
ApricotFramework.Captcha
reCAPTCHA, hCaptcha and Cloudflare Turnstile behind one interface, with each provider's answer normalised into the same result and judged against what the endpoint declared it needs — a minimum score, a set of actions, a set of hostnames. Providers are named instances, so one service can hold a different key per surface or per tenant.
ApricotFramework.Captcha is the zero-dependency core.
Install
dotnet add package ApricotFramework.Captcha.AspNetCore
dotnet add package ApricotFramework.Captcha.ErrorDefinitions # to answer with problem+json
Usage
builder.Services.AddCaptcha(builder.Configuration);
{
"Captcha": {
"DefaultProvider": "Default",
"Providers": {
"Default": { "Type": "recaptcha", "SiteKey": "6Lc...", "Secret": "..." },
"AdminPortal": { "Type": "recaptcha", "SiteKey": "6Lc...", "Secret": "..." }
}
}
}
// Provider names a configured instance, so this surface uses a key of its own.
[HttpPost("sign-in")]
[ValidateCaptcha(Provider = "AdminPortal", Policy = CaptchaValidationPolicy.High,
AllowedActions = ["sign_in"])]
public Task<SignInResult> SignIn(SignInRequest request) => this.service.SignIn(request);
The client sends Captcha-Response with the token, plus Captcha-Type and Captcha-SiteKey
describing what it solved. Those describe the challenge; the server decides which configured instance
verifies it.
Note. A requirement the provider cannot answer fails rather than passing. reCAPTCHA v2 and Turnstile report no score, so naming any
Policytier rejects their tokens asscore_unavailable;Unspecifiedis the only tier that accepts a provider without one. Declaring no tier and no actions is how an endpoint accepts anything genuine.
Full documentation at projectapricot.dev.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ApricotFramework.Captcha:
| Package | Downloads |
|---|---|
|
ApricotFramework.Captcha.AspNetCore
ASP.NET Core integration for ApricotFramework.Captcha: a guard that reads the challenge token from the request headers, a [ValidateCaptcha] action filter that enforces requirements per endpoint, and configuration-bound providers whose secrets are validated at startup. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 153 | 8/17/2026 |