Table of Contents

Class CaptchaOptions

Namespace
NuvTools.Security.Captcha
Assembly
NuvTools.Security.dll

Configuration for the anti-bot protection (Google reCAPTCHA Enterprise) applied to public endpoints.

public sealed class CaptchaOptions
Inheritance
CaptchaOptions
Inherited Members

Remarks

Adaptive model: a score key runs invisibly on every submission; when the risk is high (score below MinScore), the client presents the checkbox key as a step-up challenge. Verification creates an assessment on the reCAPTCHA Enterprise API (Google Cloud).

Fields

SectionName

Configuration section name this options class binds to.

public const string SectionName = "Captcha"

Field Value

string

Properties

ApiKey

API key used to authenticate the assessment call. Server-side only — it is never exposed to the client.

public string ApiKey { get; set; }

Property Value

string

AssessmentBaseUrl

Base endpoint of the reCAPTCHA Enterprise assessment API.

public string AssessmentBaseUrl { get; set; }

Property Value

string

Enabled

Enables or disables verification. Leave false in development and testing so no token is required; enable it in staging and production.

public bool Enabled { get; set; }

Property Value

bool

FailureMessage

Message returned to the caller when verification fails in checkbox mode. Set it from configuration to serve the application's own language.

public string FailureMessage { get; set; }

Property Value

string

MinScore

Score threshold (0.0 = likely a bot, 1.0 = likely a human). Submissions scoring at or above this value pass through; below it, the checkbox step-up is required. Defaults to 0.5.

public double MinScore { get; set; }

Property Value

double

ProjectId

Google Cloud project id where the reCAPTCHA Enterprise keys were created.

public string ProjectId { get; set; }

Property Value

string

ScoreSiteKey

Key id of the environment's score (invisible) key, used in the default flow. Must be the same key configured on the client.

public string ScoreSiteKey { get; set; }

Property Value

string

SiteKey

Key id of the environment's checkbox key, used as the step-up challenge when the score is low. Must be the same key configured on the client.

public string SiteKey { get; set; }

Property Value

string