Griesoft.OrchardCore.ReCaptcha
2.0.1
dotnet add package Griesoft.OrchardCore.ReCaptcha --version 2.0.1
NuGet\Install-Package Griesoft.OrchardCore.ReCaptcha -Version 2.0.1
<PackageReference Include="Griesoft.OrchardCore.ReCaptcha" Version="2.0.1" />
paket add Griesoft.OrchardCore.ReCaptcha --version 2.0.1
#r "nuget: Griesoft.OrchardCore.ReCaptcha, 2.0.1"
// Install Griesoft.OrchardCore.ReCaptcha as a Cake Addin #addin nuget:?package=Griesoft.OrchardCore.ReCaptcha&version=2.0.1 // Install Griesoft.OrchardCore.ReCaptcha as a Cake Tool #tool nuget:?package=Griesoft.OrchardCore.ReCaptcha&version=2.0.1
Orchard Core reCAPTCHA Module
An Orchard Core reCAPTCHA module that is based on our ASP.NET Core reCAPTCHA service.
The latest release build of this module is compatible with Orchard Core version 2.0.0
.
Installation
To install, use the NuGet package manager:
PM> Install-Package Griesoft.OrchardCore.ReCaptcha
Prerequisites
The reCAPTCHA service, provided by Google, requires registration. Sign up here. For more information, refer to Google's guide.
Post-registration, you will receive a Site key and a Secret key, necessary for configuring the service in your app.
Enable the Feature
In the Admin panel, navigate to Configuration -> Features
. Search for ReCaptcha
and enable the module provided by us.
Configuration
Navigate to Configuration -> Settings -> ReCaptcha
. Enter your Site and Secret keys acquired earlier and click save.
Hint: You can also configure the service via app settings. For more information, refer to this guide. This method also supports multi-tenancy.
Usage
The module includes parts for each reCAPTCHA challenge type (Invisible, V2, V3) that you can attach to your content types. Additionally, it provides widgets, which are particularly useful with the OrchardCore.Forms
module.
Ensure the part or widget is rendered inside the <form>
element. Depending on the reCAPTCHA type, it may render a submit button for your form, initiating the challenge and submitting the form upon successful completion.
You can customize the post-challenge behavior by specifying a custom JS callback function. In this case, ensure to submit your form within this callback.
Placing the challenge outside a form is possible, but you must ensure the challenge token from reCAPTCHA is included in the form submission. This can be done in three ways:
- As a value in the form request header named
G-Recaptcha-Response
- As an input within the form named
g-recaptcha-response
- As a query parameter in the form request named
g-recaptcha-response
For customizing part or widget templates and accessing tag helpers, add the following to your _ViewImports.cshtml
:
@using Griesoft.OrchardCore.ReCaptcha
@addTagHelper *, Griesoft.OrchardCore.ReCaptcha
Validation
This module includes validation tasks for workflows to validate incoming HTTP requests.
For validating requests in code (e.g., in controllers or actions), use the validation attributes from the base package. Refer to the base repository instructions. Importantly, use the Griesoft.AspNetCore.ReCaptcha namespace for accessing the ValidateRecaptcha attribute and related validation logic and services.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Griesoft.AspNetCore.ReCaptcha (>= 2.3.0)
- OrchardCore.ContentManagement (>= 2.1.3)
- OrchardCore.ContentTypes.Abstractions (>= 2.1.3)
- OrchardCore.DisplayManagement (>= 2.1.3)
- OrchardCore.Module.Targets (>= 2.1.3)
- OrchardCore.Navigation.Core (>= 2.1.3)
- OrchardCore.ResourceManagement (>= 2.1.3)
- OrchardCore.Workflows.Abstractions (>= 2.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.