Installation

Supported versions


  • .NET >= 6

Installation


To work with NuGet, as a package consumer or creator, you can use command-line interface (CLI) tools as well as NuGet features in Visual Studio.
You can choose one of the following ways:

Install and use a NuGet package in Visual Studio

Install HumanModule using the NuGet Packge Manager in Visual Studio:

  1. Select Project > Manage NuGet Packages.
  2. In the NuGet Package Manager page, choose nuget.org as the Package source.
  3. From the Browse tab, search for HumanModule, select HumanModule in the list, and then select Install.

Install and use a package with the dotnet CLI

To install HumanModule, run the following command:

dotnet add package HumanModule

Integration

Edit program.cs

Add Human Module

using human_module

Use HumanModule as a Middleware in your application:

app.UseHumanMiddleware();

Add configuration section (configuration level)

builder.Services.Configure<EnforcerConfig>(builder.Configuration.GetSection("HumanConfiguration"));

Add site specific configuration (configuration level)
On your app configuration JSON file (Default file name appsettings.json), add the following section:

...
"HumanConfiguration": {
    "px_app_id": "XXX",
    "px_cookie_secret": "XXX",
    "px_auth_token": "XXX",
    Other Human configuration options...
}

Configuring Required Parameters

Configuration options are set in EnforcerConfig

Required parameters:

  • px_app_id
  • px_cookie_secret
  • px_auth_token

Upgrading

To upgrade to the latest Enforcer version:

  1. In Visual Studio, right click on the solution and Select Manage NuGet packages for solution.
  2. Search for HumanModule in the updates section, and update.