开发者

Licensing modules on a web-application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 7 years ago.

开发者_StackOverflow Improve this question

Let's say that you have a Web Site that has a bunch of different modules to it such as:

  • Accouting ( Handle customers, invoices, etc )
  • Notes and Documents ( Create and Manage your documents )
  • Many more..

How would you restrict access one of the "Modules" if one customer does not have the appropriate license?

I've often seen components that comes with a .lic file, how do you generate one of those?

And if you use a method like that does it affect performance?

Edit

Another thing I was thinking about, if you ship all modules with your application and you only want to show the controls that you have licensed, do you need to check each control for validity or can you somehow extract that information?


You can use one of the existing open source solutions to generate and validate license files including information about allowed modules/features:

  • Rhino Licensing
  • Portable.Licensing

Boths tools allow you to store additional data to the license file -> in your case the allowed modules.

Using the Portable.Licensing solution you can use product features or additional license data to add the allowed modules:

var license = License.New()  
    //... other options
    .WithProductFeatures(new Dictionary<string, string>  
                              {  
                                  {"Accouting", "yes"},  
                                  {"Notes and Documents", "yes"}
                              })  
    // ... other options
    .CreateAndSignWithPrivateKey(privateKey, passPhrase);

To verify the modules:

if (license.ProductFeatures.Contains("Accouting"))
    // ...

DISCLAIMER: i'm the author of the Portable.Licensing open source project


One way to do this to have have a bit array in which each flag corresponds to a particular module or feature. While generating a license, set the bit array according to the modules that the customer has purchased, then sign this bit array using an algorithm such as RSA. Then, in your software, verify the signature and retrieve the bit array to determine which modules to activate.

Take a look at CryptoLicensing which has support for this very scenario - you can specify upto 2040 features/modules in each generated license.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜