View on GitHub

Getting Started with Distributor

Using Distributor to manage Concurrent/Floating Licensing for your Application

Welcome to the Getting Started with Distributor Licensing guide. The purpose of this document is to get you, a first time user, up and running quickly when using the Software Potential Service to implement floating/concurrent licensing of your .NET application.

Overview

Software Potential Distributor allows you to quickly and effectively implement floating / concurrent licensing of your applications. One or more Distributor instances can be quickly installed on the customers’ premises enabling:

Distributor has been generally available from the 3.1.1921 release of the Software Potential Service. Distributor clients can interoperate with server instances of different versions from that release onward.

How it Works

When an application is Distributor-aware, licenses can be activated and stored in a central Distributor service and then dynamically allocated across multiple deployed instances of the application. Each application instance includes a local Sp.Agent extension that must be configured to identify a Distributor Service instance. A service instance can be hosted locally on one of the client machines or, more typically, on a separate network-accessible machine.

Whenever protected code that requires a license is encountered for the first time, the Sp.Agent component will query the Distributor service for the Feature required to execute the protected code. The service will yield a lease for the requested feature if there is one available (based on the licenses installed in Distributor instance and allocations held by other competing application instances.)

Any such allocated leases are automatically renewed until such time as the application instance is closed (enabling execution not to be subject to a network round-trip every time).

Concurrency Limitations

It is possible to set a limit on the number of instances of the licensed application that can be run concurrently for a given Distributor license. The Distributor instance will refuse requests from additional application instances once the limit has been reached.

If a Distributor license includes features then by default all instances of the application will have access to all included features. However, it is possible to also set limits on individual features such that only a subset of the permitted concurrent instances can access individual features. The limit set at feature level must be equal to or less than the value set at the instance level.

For example it is possible to issue a license with two features ("Feature A" and "Feature B") that allows x3 instances of a licensed application to run concurrently, where each instance is able to access Feature A but only one instance can access Feature B at any given time.

Checkout / Disconnected Mode

With Distributor, it is also possible to switch a protected application to Disconnected mode. This facility is useful where the application needs to run in a context where it will not be possible to communicate to a Distributor service instance for a period of time e.g. when the user is working remotely while out of the office or on vacation.

To operate in Disconnected mode the user must first, while connected to Distributor, check out the required Features for a given period of time. These checked out Features are then reserved on the service for this extended period and cached on the local machine for the duration of the checkout period, allowing the Protected application to run without any contact with the service.

The cached features can be checked in (at a time when network connectivity has been restored) under the control of the application. At this point, the long term leases on the server are released and allocation once again switches to Connected mode.

Enabling Your Application to work with Distributor

To configure your application for use with Distributor you will need to add the SoftwarePotential.Distributor.Configuration-<PermutationShortCode> NuGet package to your solution and provide a user facility to configure the application with a Distributor Endpoint URI.

To connect to a Distributor instance, the application must be configured with a Distributor endpoint URI, which takes the form: http://<DistributorServerName>:<PortNo> where:

Please see the Configuration.Distributor-README for more detailed information on enabling your application to work with Distributor.

Packaging Distributor Server

In addition to enabling your application via the Distributor client components, you will also need to package the Distributor Server so that it can be installed on-premise by your customers. The process is straightforward and involves:

Please see Sp.Distributor-README for more details on the packaging and installing of Distributor.

Installing Distributor Server

Once installed the Distributor Service can be stopped/started/restarted via the Services Snap-in (find the Software Potential Distributor Service, and right click to select Stop, Start or Restart as appropriate). It can also be managed using install.cmd batch file e.g. Install.cmd -stop, Install.cmd -start, install.cmd -install, install.cmd -uninstall.

Configuring Distributor Server

Distributor Endpoint

By default the Distributor service listens on Port 8731 for feature allocation requests from appropriately configured licensed applications. A new port can be allocated to suit a customer environment by changing the port number value of the Slps.Distributor.Service.BaseUri key in ..\Slps.Distributor.Hosts\Services\Slps.Distributor.Services.dll.config

Administrating Distributor Server

Distributor is administered via Web Administration portal available at http://<DistributorServer>:2468/web where is the fully qualified domain name (or the IP address) of the server on which Distributor is installed. An alternative to the default Port 2468 can be configured to suit a customer environment by changing the value of the Port property in the Slps.Distributor.Host element in ..\Slps.Distributor.Host\Slps.Distributor.Host.exe.config.

The admin portal allows your customer to:

Issuing a Distributor License

Licenses suitable for Distributor are created using the Software Potential service in the same manner as any other license. The key differences with a Distributor license are:

Distributor licenses can be created either:

Issuing a License Manually

To issue a Distributor license manually via the Software Potential portal:

FeatureConcurrentUsage

IssueNamedUserLicense

Please see Getting Started With Named User Licenses for more information on Named User Distributor licenses.

SetConcurrentUsage

Issuing a License Programmatically

You automate the issuance of a Distributor license using the Software Potential web API at https://srv.softwarepotential.com/SLMServerWS/LicenseManagementWS.svc. To create a Distributor license progammatically you will need to:

If you wish to issue a Seat Based license you will also need to add two Custom Tags: L:SeatBased and L:RequiresClient. Without these tags the license is Machine Based.

For a Named User license you will need to add the L:RequiresNamedUsers Custom Tag

Alternatively, to avoid having to create the LicenseInfo object from scratch, you could first create a SKU for the Distributor license and issue your licenses progammatically based on that SKU:

In either case the Software Potential service will return you the Activation Key for the license you've just created and you will need to forward this to your customer to enable them to activate the license in a Distributor instance.

Activating a Distributor License

Distributor licenses are activated using the Distributor Web Administration portal. By default this is located at http://<DistributorServer>:2468/web where is the fully qualified domain name (or the IP address) of the server on which Distributor is installed. (NOTE It is possible to configure a Distributor server instance to use a different port to the default 2468. See Customizing Distributor Settings).

There are two ways to activate a Distributor license depending on whether the machine on which Distributor is installed has internet access or not.

Online Activation

If the machine on which Distributor is installed has internet access then:

Distributor_ActivationOnline

The page will display an appropriate message if the activation has been successful and an appropriate error message if unsuccessful.

Distributor_ActvationSuccess

Manual Activation

If the machine on which Distributor is installed has no direct internet access available then:

Distributor_ActivationManual

As with Online activation mode the page will display an appropriate message if the activation has been successful and an appropriate error message if unsuccessful.

Viewing Activated Licenses in Distributor

Select the Products tab and then Show Licenses link to display a summary of the license installed. Select the More link to see the details of a given license.

Distributor_ViewLicenses

That’s it! Distributor is now ready to automatically allocate features to instances of protected applications that have been correctly configured to communicate with it.