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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ApricotFramework.Captcha" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApricotFramework.Captcha" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ApricotFramework.Captcha" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ApricotFramework.Captcha --version 0.1.0
                    
#r "nuget: ApricotFramework.Captcha, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ApricotFramework.Captcha@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ApricotFramework.Captcha&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ApricotFramework.Captcha&version=0.1.0
                    
Install as a Cake Tool

ApricotFramework.Captcha

NuGet NuGet NuGet CI License

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 Policy tier rejects their tokens as score_unavailable; Unspecified is 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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