Niobium.Platform.Captcha.ReCaptcha 4.2.66

dotnet add package Niobium.Platform.Captcha.ReCaptcha --version 4.2.66
                    
NuGet\Install-Package Niobium.Platform.Captcha.ReCaptcha -Version 4.2.66
                    
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="Niobium.Platform.Captcha.ReCaptcha" Version="4.2.66" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Niobium.Platform.Captcha.ReCaptcha" Version="4.2.66" />
                    
Directory.Packages.props
<PackageReference Include="Niobium.Platform.Captcha.ReCaptcha" />
                    
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 Niobium.Platform.Captcha.ReCaptcha --version 4.2.66
                    
#r "nuget: Niobium.Platform.Captcha.ReCaptcha, 4.2.66"
                    
#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 Niobium.Platform.Captcha.ReCaptcha@4.2.66
                    
#: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=Niobium.Platform.Captcha.ReCaptcha&version=4.2.66
                    
Install as a Cake Addin
#tool nuget:?package=Niobium.Platform.Captcha.ReCaptcha&version=4.2.66
                    
Install as a Cake Tool

Niobium.Platform.Captcha.ReCaptcha

Niobium.Platform.Captcha.ReCaptcha provides Google reCAPTCHA v3/v2 integration and risk assessment for .NET applications using the Niobium.Platform framework. It enables secure, tenant-aware bot protection and visitor risk analysis for APIs and web applications.

What is this project about?

  • Implements the IVisitorRiskAssessor interface for Google reCAPTCHA, supporting token validation and risk scoring.
  • Provides a DI module for easy registration and configuration in .NET and Azure Functions projects.
  • Supports multi-tenant secret management and development-mode bypass.
  • Enables secure, extensible bot protection and risk assessment for consumer projects.

Getting Started

1. Install the NuGet Package

dotnet add package Niobium.Platform.Captcha.ReCaptcha

2. Register Captcha Services

In your application's DI setup, use the provided extension method:

using Niobium.Platform.Captcha.ReCaptcha;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCaptcha(options =>
{
    options.IsDisabled = false;
    options.Secrets = new Dictionary<string, string>
    {
        ["tenant1"] = "<your-recaptcha-secret-for-tenant1>",
        ["tenant2"] = "<your-recaptcha-secret-for-tenant2>"
    };
});

Or, for Azure Functions:

using Niobium.Platform.Captcha.ReCaptcha;

var host = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults(worker =>
    {
        worker.Services.AddCaptcha(options =>
        {
            options.IsDisabled = false;
            options.Secrets = new Dictionary<string, string>
            {
                ["tenant1"] = "<your-recaptcha-secret-for-tenant1>",
                ["tenant2"] = "<your-recaptcha-secret-for-tenant2>"
            };
        });
    })
    .Build();

3. Configure Captcha Options

Add your reCAPTCHA secrets and settings to your configuration (e.g., appsettings.json):

{
  "CaptchaOptions": {
    "IsDisabled": false,
    "Secrets": {
      "tenant1": "<your-recaptcha-secret-for-tenant1>",
      "tenant2": "<your-recaptcha-secret-for-tenant2>"
    }
  }
}

4. Use the Visitor Risk Assessor

Example: Assessing a Captcha Token

var riskAssessor = serviceProvider.GetRequiredService<IVisitorRiskAssessor>();
bool isLowRisk = await riskAssessor.AssessAsync(token, requestID: "req-123", tenant: "tenant1", clientIP: "1.2.3.4");

If IsDisabled is true or in development mode, all requests are considered low risk.

How Niobium.Platform.Captcha.ReCaptcha is Consumed

Consumer projects (such as Niobium.Invoicing) use Niobium.Platform.Captcha.ReCaptcha to:

  • Register and use Google reCAPTCHA risk assessment via DI.
  • Secure APIs and endpoints with tenant-aware bot protection.
  • Integrate risk assessment into business logic and validation flows.

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with clear commit messages
  4. Submit a pull request

Please ensure your code follows the existing style and includes appropriate tests and documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.2.66 86 9/4/2026
4.0.60 108 8/30/2026
4.0.53 146 8/27/2026
4.0.48 136 8/9/2026
4.0.47 112 8/8/2026
4.0.46 103 8/8/2026
4.0.45 146 7/19/2026
4.0.44 111 7/19/2026
4.0.42 190 7/18/2026
4.0.37 111 7/17/2026
4.0.35 121 7/17/2026
4.0.34 133 7/17/2026
4.0.33 117 7/16/2026
4.0.32 207 7/2/2026
3.4.30 216 12/22/2025
3.4.29 317 11/11/2025
3.4.28 212 11/2/2025
3.4.27 151 11/1/2025
3.4.26 147 11/1/2025
3.4.25 149 11/1/2025
Loading failed