Persilsoft.Recaptcha.Blazor
1.0.36
See the version list below for details.
dotnet add package Persilsoft.Recaptcha.Blazor --version 1.0.36
NuGet\Install-Package Persilsoft.Recaptcha.Blazor -Version 1.0.36
<PackageReference Include="Persilsoft.Recaptcha.Blazor" Version="1.0.36" />
<PackageVersion Include="Persilsoft.Recaptcha.Blazor" Version="1.0.36" />
<PackageReference Include="Persilsoft.Recaptcha.Blazor" />
paket add Persilsoft.Recaptcha.Blazor --version 1.0.36
#r "nuget: Persilsoft.Recaptcha.Blazor, 1.0.36"
#:package Persilsoft.Recaptcha.Blazor@1.0.36
#addin nuget:?package=Persilsoft.Recaptcha.Blazor&version=1.0.36
#tool nuget:?package=Persilsoft.Recaptcha.Blazor&version=1.0.36
Persilsoft.Recaptcha.Blazor
It exposes a service that allows you to obtain a reCAPTCHA token and validate that token through a verification endpoint that you need to add to your backend.
Example
First, you need to register the following service group in the dependency container.
using Persilsoft.Recaptcha.Blazor.Options;
using ServiceCollectionExtensions;
Action<RecaptchaOptions> recaptchaOptionsConfigurator = options =>
builder.Configuration.GetSection(RecaptchaOptions.SectionKey).Bind(options);
builder.Services.AddRecaptchaServices(recaptchaOptionsConfigurator);
In the appsetting.json configuration file, you need to configure the following key:
"RecaptchaOptions": {
"WebApiBaseAddress": "https://persilsoft.api",
"VerifyRecaptcha": "/recaptcha/verify",
"SiteKey": "xxxxxxxxxxx"
}
Where:
WebApiBaseAddress: It is the Base URL of your backend server that will expose the token verification endpoint.
VerifyRecaptcha: It is the token verification endpoint on your backend server.
SiteKey: It is your website key, also known as the reCAPTCHA key.
Now, you can use the service in your Razor page.
@page "/recaptcha"
@using Persilsoft.Recaptcha.Shared.Interfaces
@inject IRecaptchaService RecaptchaService
<h3>Demo</h3>
<EditForm Model="@model" OnValidSubmit="Send">
<DataAnnotationsValidator />
<div class="mb-3">
<label for="name" class="form-label">Nombre</label>
<input type="text" @bind="model.Name" class="form-control" id="name" name="name" />
<ValidationMessage For="@(() => model.Name)" />
</div>
<div class="d-grid gap-2 col-6 mx-auto">
<button class="btn btn-danger" type="submit">Enviar</button>
</div>
<hr />
<div class="mt-3">
<textarea disabled class="form-control">
@result
</textarea>
</div>
</EditForm>
@code {
private readonly PersonModel model = new();
private string result;
private async Task Send()
{
try
{
await RecaptchaService.TryVerifyInteractionAsync();
result = "Successful validation!!!";
}
catch (Exception ex)
{
result = ex.Message;
}
}
public class PersonModel
{
[Required(ErrorMessage = "{0} is required.")]
public string Name { get; set; }
}
}
Note: The invocation of the TryVerifyInteractionAsync method will throw an exception if the reCAPTCHA validation process fails.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Microsoft.AspNetCore.Components.Web (= 9.0.4)
- Microsoft.Extensions.Http (= 9.0.4)
- Persilsoft.Blazor.JSInterop (= 1.0.12)
- Persilsoft.HttpDelegatingHandlers (= 1.0.18)
- Persilsoft.Recaptcha.Shared (= 1.0.10)
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 |
|---|---|---|
| 1.0.40 | 168 | 12/13/2025 |
| 1.0.39 | 613 | 12/1/2025 |
| 1.0.38 | 421 | 5/2/2025 |
| 1.0.37 | 317 | 4/13/2025 |
| 1.0.36 | 216 | 4/13/2025 |
| 1.0.35 | 260 | 4/12/2025 |
| 1.0.34 | 465 | 3/20/2025 |
| 1.0.33 | 254 | 3/20/2025 |
| 1.0.32 | 259 | 3/19/2025 |
| 1.0.31 | 815 | 10/16/2024 |
| 1.0.30 | 193 | 10/16/2024 |
| 1.0.29 | 165 | 10/15/2024 |
| 1.0.28 | 233 | 10/14/2024 |
| 1.0.27 | 228 | 10/6/2024 |
| 1.0.26 | 220 | 10/4/2024 |
| 1.0.25 | 214 | 10/4/2024 |
| 1.0.24 | 227 | 9/1/2024 |
| 1.0.23 | 231 | 8/28/2024 |
| 1.0.22 | 194 | 8/28/2024 |
| 1.0.21 | 203 | 8/18/2024 |