Alcazar Security Solutions

API Products

Licensing

Introduction to the Alcazar License framework

Alcazar License

Licensing is a crucial aspect of software development for every commercial application. You may have a great product, but without a proper licensing mechanism, you risk losing revenue and control over your software. Every software provider has their own structure of how it wishes to license products to clients, and the licensing scheme you use should not restrict you from implementing your desired licensing model. Implementing your own licensing mechanism can be a daunting task, and often leads to reinventing the wheel.

The Alcazar License framework provides a simple, easy-to-use, yet comprehensive solution for implementing licensing in your applications.
It supports various license types, including trial, perpetual, and subscription licenses, and allows for flexible license management.

Key Features

  • Distribute your license keys as signed JWT tokens or signed XML documents.
  • Define your own license types, such as trial, perpetual, and subscription licenses.
  • Define your own license restrictions, such as time-based, usage-based, or feature-based restrictions.
  • Define your own license scopes. A scope specifies features or functionalities that are enabled by the license. You can define an unlimited number of scope restrictions.
  • Define your own license products. A product is a software product that is licensed to the customer. One license can be issued for multiple products, and a product can have multiple licenses.
  • Validate licenses at runtime, ensuring that your application only runs with valid licenses. You can use our built-in validators for common scenarios or implement your own custom validators.

HOW-TO implement licensing for your project

Implementing the Alcazar License framework is a simple process that involves a few steps:

1. Design your license structure. This includes setting a unique product name and identifying a list of scope values, which can be used to restrict functionality

2. Register the license provider. The license provider is a certificate which is included in your assembly. Licenses are signed using the private key associated with this certificate, and the provider will validate the license using the certificate. In most cases, the default registration will suffice:

LicenseProviders.Register(new AssemblyName(“YourCompany.Provider”));

3. Apply the `Licensed` attribute to classes which you want to secure. Apply the product name to the `Licensed` attributes. Apply a space-separated list of scope values to the `Licensed` attributes.

[Licensed(“Biostore”, Scope = “rest identity”)]

4. Create a license using the Alcazar License configuration pages or by using the `LicenseBuilder` class in code. The license can be generated as a signed JWT token or as a signed XML document.

5. Install the license in the application. For generic licenses, such as built-in demo licenses, you can include the license in your application as an embedded resource. For client-specific licenses, you can provide the license file to the client, who can place it into the configuration folder or database.

6. Validate licenses. At strategic places in the code of your application, when you instantiate licensed classes or utilise licensed functionality, validate the license.

LicenseValidator.Validate<YourClass>();
LicenseValidator.Validate(yourObject);

For commonly used classes, the framework performs this validation automatically. Examples include:

  • ASP.Net MVC controllers which inherit from `System.Web.Mvc.Controller`