dcvchicago
Joined: 01 Sep 2006 Posts: 12
|
Posted: Thu Dec 21, 2006 11:24 pm Post subject: Adding user name to licensing |
|
|
I want to share something I've learned about adding a user name, or a company name, or almost anything similar to to a license.
I've set up my licensing to require both a user name and a password. We provide both of these to the purchaser in their confirmation email. If you have looked through the posts on this board, you know that the recommended way of adding the name is to take a chucksum of the name, using the EncryptedLicense.Checksum() method. Then, when you create the license key, enter that checksum in the Product Info field.
I use a custom Enter License Info dialog instead of the standard Infralution licensing dialog. On my dialog, when the user clicks the OK button, the dialog validates the license key and the user name. If either is incorrect, the dialog cancels the OK button click and puts an error glyph next to the field with the error. That way, the license never gets registered unless the correct key and user name are entered.
Until now, when my code checks the license at runtime, I've had it validate both the license key and the user name. But it's not really necessary to validate both--a check of the license key is sufficient, since the license would never have been registered in the first place unless the correct user name had been entered. And that ensures that if someone gives out their license key, they give out their user name, as well.
That simplifies runtime checks considerably. It eliminates the need to store the user name, unless you want to display it on an 'About' box. A really clever thief might figure all this out, and might post their key on a cracking board with instructions on how to store it without going through the licensing dialog, but that's a whole lot of trouble to go through.
So the bottom line is this: If you validate the user name and license key at point of entry, then you may be able to dispense with the user name check at runtime, simplifying your code and speeding things up just a bit.
David Veeneman |
|