Surevelox.OrchardCore.Licensing 1.5.0-rc-20230116.2

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

// Install Surevelox.OrchardCore.Licensing as a Cake Tool
#tool nuget:?package=Surevelox.OrchardCore.Licensing&version=1.5.0-rc-20230116.2&prerelease                

Licensing - Surevelox.OrchardCore.Licensing

The Licensing module for Orchard Core CMS.

For Orchard Core module consumers

Manage all your module/feature license keys for module orchard core module that you purchased from orchard core module vendor.

For Module vendors

Build your module with license and let your customer use this module to manage their licenses for your module.

Key Features

Features

  • Manage License keys using Admin Panel
  • Provides API to module vendor to implement license in their own module.

Install

Add Surevelox.OrchardCore.Licensing to your Orchard Core Web project


dotnet add package Surevelox.OrchardCore.Licensing

Enable Feature using recipe

Include in Setup Recipe to enable the feature by default.

"steps": [
    {
      "name": "feature",
      "enable": [
        "Surevelox.OrchardCore.Licensing"
      ]
    }
 ]

License management

License management

Add Licensing support in your module

1. Implement ILicenseHandler

Implement CanHandle and Handle method, this method is called when user adds license key in Admin UI.

    internal class LicenseHandler : ILicenseHandler
    {
         public bool CanHandle(string licenseKey)
        {
            return true;
        }
        public void Handle(LicenseValidationContext context,
            out LicenseStatus? status, out string id, out DateTime? issuedUtc, out DateTime? expiresUtc,
            out Dictionary<string, object> policies)
        {
            var key = context.LicenseKey;

            // Add your own logic to see if the license key is belong to your module
            // For example using microsoft standard licensing
            LicenseManager.CurrentContext = context;
            var license = LicenseManager.Validate(typeof(MyLicensedClass));
            var canhandle = (license != null);
            if (canhandle)
            {
                // get the license and polices from encrypted license file 
                status = LicenseStatus.Valid;
                // Read from your license
                issuedUtc = license.IssuedOn;
                // Read from your license 
                expiredUtc = license.ExpiresOn;
                // add your feature list 
                features = policies["features"];
                id = "lic/my-product/" + license.Id;
            }
            else
            {
                // If key is unknown to this validator 
                id = null;
                status = null;
                createdUtc = null;
                expiredUtc = null;
                features = new string[] { };
            }
        }
    
    }
2. Register ILicenseHandler in startup
     services.AddOrchardCms()
                .ConfigureServices( svc=>
                {
                    svc.AddScoped<ILicenseHandler, LicenseHandler>();
                });

Documentation

Read the documentation here

Feedback

See the open issues for a list of proposed features and known issues.

Like? Support Us.

Like the the module? Support us by sponsoring Surevelox @ Github.

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.