Griesoft.OrchardCore.ReCaptcha 0.8.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Griesoft.OrchardCore.ReCaptcha --version 0.8.4
NuGet\Install-Package Griesoft.OrchardCore.ReCaptcha -Version 0.8.4
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="Griesoft.OrchardCore.ReCaptcha" Version="0.8.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Griesoft.OrchardCore.ReCaptcha --version 0.8.4
#r "nuget: Griesoft.OrchardCore.ReCaptcha, 0.8.4"
#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.
// Install Griesoft.OrchardCore.ReCaptcha as a Cake Addin
#addin nuget:?package=Griesoft.OrchardCore.ReCaptcha&version=0.8.4

// Install Griesoft.OrchardCore.ReCaptcha as a Cake Tool
#tool nuget:?package=Griesoft.OrchardCore.ReCaptcha&version=0.8.4

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.

Build Status Build Status License NuGet GitHub Release

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 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. 
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
1.0.0 331 1/24/2024
0.8.8 672 10/13/2022
0.8.7 496 8/18/2022
0.8.6 403 8/14/2022
0.8.5 424 8/14/2022
0.8.4 427 8/14/2022
0.8.3 499 6/14/2022
0.8.2 527 5/2/2022
0.8.1 491 5/1/2022
0.8.0 484 5/1/2022