Learning CryptLex, Stuck with a grace period over code

Hi , I’m trying to get started with Cryptlex and licensing in general for me. I’ve got a C++ application and we’re statically linking the LexActivator. I made a test license and things were working on Friday, today I kept getting a return code of LA_GRACE_PERIOD_OVER(22) from IsLicenseGenuine. I’ve tried using a different key but when I call GetLicenseKey it still uses the previously entered key.

Unfortunately I’m kind of stuck at this point. I’m sure I’m doing something incorrectly and need help figuring out what. Thank you.

Hi Christopher,

The IsLicenseGenuine() function verifies the license activation data locally (from the disk). After verifying locally, it schedules a server check in a separate thread.

After the first server sync it periodically does further syncs at the server sync frequency set for the license till the app is running.

In case server sync fails due to network error, and it continues to fail for fixed number of days (grace period), the function returns LA_GRACE_PERIOD_OVER instead of LA_OK.

Now either ask your customer to connect to the internet, or treat LA_GRACE_PERIOD_OVER as success code.

You can also allow infinite grace period by setting “Server Sync Grace Period” property of license to “0”.

Thank you for replying, The computer in question is my own, I’m implementing the license management so this is just for testing purposes. What is the grace period for?

Also, how do I change a license key? I know deactivating a license needs to be done through the web portal/api, but if a user has a new key how do they change it? I’ve run into this difficulty during my testing even though I don’t anticipate it happening much in the field.

The grace period is to enforce server sync for your customers if that matters in your use-case. Else this should be set to 0.

You can just call SetLicenseKey() followed by ActivateLicense(), or better would be to call DeactivateLicense() function first before activating the new license key.

Hi.

Some of our users with licenses and internet connections are reporting that they are encountering this error every 2 weeks or so.

In logs we can see that license check: LexActivator.IsLicenseGenuine()
returns: LA_GRACE_PERIOD_OVER(22)

After entering same license key user can continue until next time.

But in our case extending grace period is not an option as well as ignoring LA_GRACE_PERIOD_OVER

We are using Cryptlex.LexActivator v3.19.1

May be you have some suggestions?

Hi,

Why can’t you just increase the value of grace period if two weeks is not enough?

Ok then error window will pop-up once in a month. And making a grace period infinite is not the best idea.

If you set it to one month then if server sync fails continuously for one month (or app is no opened for one month), the error will show up. It seems your customers do have an internet connection available, so this should not happen. Are you using IsLicenseValid() function instead of IsLicenseGenuine() function?

Yes we are using LexActivator.IsLicenseGenuine()
This issue is also reported by our analysts team. They encounter this issue periodically as well. So it is not only one user issue. And extending period to one month is not a real solution but a workaround.

Can you confirm which of the two issues causes this problem in your case:

  1. Server sync fails continuously for one month due to unavailability of the internet
    or
  2. App is opened after one month