Creating a Licensed Plugin

The simplest way to set up a plugin with licensing is to use the License Creator Plugin. This will let you create a product, define what rules apply to it, generate the Java code for your plugin project and finally, create license keys that will validate in that plugin.

1. Creating a Product

A product is the generic name for anything which can have a license applied. In our example, it will be a Confluence plugin.

Create an Issuer.

This is the unique entity that will issue the license keys. The details here are used to create the unique public/private key set that will be used to sign the license key, so once these details are set, they can't be changed.

Create a Product.

Here, we set the details for the product in question.

Name The name of the product.
Target Application The type of application the product will be.
Issuer The entity issuing licenses for the product.
Description The description of the product.

Specify Product Rules.

At this point, we can add various rules to the product. The rules can be modified later, but be aware that you will a) have to regenerate the source code pick up the rule changes, and b) you may invalidate some old license keys, depending on the rules.

There are two types of rules:

1. Exemptions: These will allow a product to run without a valid license key if the exemption criteria is met. For example, allowing servers running on a 'free' confluence license (open source, community, etc) to run the plugin without a license installed at all.

2. Restrictions: These are additional restrictions which will be checked to see if the license is valid. These might be a fixed expiry date, a maximum number of users, etc.

2. Generating Code

Next, we need to create some code to actually do the license checking. As much as possible, this code can be generated by the plugin - all you need to do is copy-n-paste into the right spot.

  1. Select 'view' for a product.
  2. Select 'generate code' from the list of actions at the bottom of the page.
  3. Enter the target package name for the plugin (eg 'org.foo.bar').
  4. Click 'Generate'.

Now, look through the list of files that are generated. Each lists the target file name and destination in your project. Create each file and copy-n-paste it into your plugin project.

Once done, there should now be a 'License Details' link under the plugin's name in the 'Admin Console' list when you install it.

3. Creating Licenses

To create a license, just click the 'create license key' action on the product in question.

  1. Complete any details for the license recipient.
  2. Fill out any extra values for the rules that apply to this product. Most 'Restriction' rules will have a value to specify for the license key, such as the expiry date, etc.
  3. Select either 'create text' or 'create file' to generate the license key.
    • 'create text' will output the key as a block of text which can be easily copy-n-pasted into an email, or into the 'License Details' screen of the product. Note: currently only Confluence provides such a screen.
    • 'create file' will output the key as a file, will be available as a download when clicking the button. These are installed via the 'license upload' option in 'License Details'.

Some Tips

  1. Don't delete products - unless you are really done with them. If you delete a product, you will have to recreate the licensing details, and all previously-generated license keys will not install after rebuilding the plugin.
  2. Use Backup to transfer your Issuers and Products onto another server. If you need to move your projects, use the Backup screen to achieve this. You can even pick an individual Product or Issuer to backup. Be careful however, since the backup fill will contain the private keys for your Issuers and Products, which will allow others to generate license keys for your plugins if they get hold of them.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.