Griesoft.OrchardCore.ReCaptcha
0.8.2
See the version list below for details.
dotnet add package Griesoft.OrchardCore.ReCaptcha --version 0.8.2
NuGet\Install-Package Griesoft.OrchardCore.ReCaptcha -Version 0.8.2
<PackageReference Include="Griesoft.OrchardCore.ReCaptcha" Version="0.8.2" />
paket add Griesoft.OrchardCore.ReCaptcha --version 0.8.2
#r "nuget: Griesoft.OrchardCore.ReCaptcha, 0.8.2"
// Install Griesoft.OrchardCore.ReCaptcha as a Cake Addin #addin nuget:?package=Griesoft.OrchardCore.ReCaptcha&version=0.8.2 // Install Griesoft.OrchardCore.ReCaptcha as a Cake Tool #tool nuget:?package=Griesoft.OrchardCore.ReCaptcha&version=0.8.2
Orchard Core reCAPTCHA Module
An Orchard Core reCAPTCHA module that is based on our ASP.NET Core reCAPTCHA service.
All features are included in this module from the base service.
Work in progress
This module is still work in progress.
Features
- Site and secret key settings
- Port tag helpers. Modify the script tag helper to register the output to the resource manager
- Validation workflows for V2 and V3
- Add a content part and a widget
- Add content part settings
The module is already usable, but you need to add the challenge into your templates with the help of the provided tag helpers.
Installation
Install in your web project via NuGet using:
PM> Install-Package Griesoft.OrchardCore.ReCaptcha
Usage
Prequisites
You will need an API key pair which can be acquired by signing up here. For assistance or other questions regarding that topic, refer to Google's guide.
After sign-up, you should have a Site key and a Secret key. You will need those to configure the service in your app.
Enable the Feature
In the Admin panel, navigate to Configuration -> Features
. Search for ReCaptcha
and enable the module that is provided by us.
Configuration
From the Admin Panel
Navigate to Configuration -> Settings -> ReCaptcha
. Now enter your Site and Secret key that you acquired earlier and hit save.
From the appsettings.json
There are two ways to add the site and secret key to your appsettings.json
file.
One is by adding the configuration to the root of the file like described here.
The other is by adding the configuration inside the OrchardCore
section. This means you will be also able to configure reCAPTCHA for multible tenants differently. An example of the latter:
"OrchardCore": {
"RecaptchaSettings": {
"SiteKey": "<Your site key goes here>",
"SecretKey": "<Your secret key goes here>"
}
}
Adding reCAPTCHA to your template
The content part for this module is still in development, but you may add a challenge to your views with the existing tag helpers in the meanwhile.
Add the following to your _ViewImports.cshtml
:
@using Griesoft.OrchardCore.ReCaptcha
@addTagHelper *, Griesoft.OrchardCore.ReCaptcha
First, add <recaptcha-script />
to the view that you want to add a challenge. That will add the necessary script to the foot of your page.
Now for a simple reCAPTCHA V2 checkbox, you would add <recaptcha />
inside your form. If you want invisible reCAPTCHA add <button re-invisible form-id="yourFormId">Submit</button>
to your form.
In case of reCAPTCHA V3 modify the recaptcha script tag like this <recaptcha-script render="V3" />
and use the <recaptcha-v3 form-id="yourFormId" action="submit">Submit</recaptcha-v3>
tag inside of your form.
Challenge Validation
If you make use of workflows, there are tasks that you may use to validate incoming HTTP requests.
If you need to validate incoming requests to your controllers or actions, you may refer to the validation documentation of the base repo. One important thing to note is that you would make use of the Griesoft.AspNetCore.ReCaptcha
namespace. That contains the ValidateRecaptcha
attribute and all other validation-related logic and services.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- Griesoft.AspNetCore.ReCaptcha (>= 2.0.7)
- OrchardCore.ContentManagement (>= 1.3.0)
- OrchardCore.ContentTypes.Abstractions (>= 1.3.0)
- OrchardCore.DisplayManagement (>= 1.3.0)
- OrchardCore.Module.Targets (>= 1.3.0)
- OrchardCore.Navigation.Core (>= 1.3.0)
- OrchardCore.ResourceManagement (>= 1.3.0)
- OrchardCore.Workflows.Abstractions (>= 1.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.