-
We are trying to implement a 14 day trial license, I've fudged the timestamp in the policy, and that works as expected. If I create a license using that policy in the Keygen dashboard, the expiry date is null until the first validation, then it uses the timestamp of the validation and adds 14 days to it to determine the expiry. Again, that's as I'd expect. The problem I have, is that from an app perspective, there is no way to get the calculated expiry date at validation time. I store the company name and license key in the Windows registry, but the expiry date is always null at this point. I tried adding a metadata key/value pair to the policy with the 14 day offset in seconds, with the hope of adding that to the validation timestamp and saving THAT value in the registry, but no luck. None of those values appear in the validation response. I considered adding the same key to the actual License as metadata, but that seems really klunky to me. Does anyone have a solution for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This behavior is due to your policy's expiration basis, which is documented here: https://keygen.sh/docs/api/policies/#policies-object-attrs-expirationBasis It sounds like you're using a Also worth noting that policy metadata is separate from license metadata — there's no inheritance i.r.t metadata. You may be able to use entitlements to store inherited metadata, if that works for you. Hope all that helps? Let me know. |
Beta Was this translation helpful? Give feedback.
Since the expiry is set asynchronously after validation, making a request to retrieve the license after validation may be a suitable workaround here. Another solution would be to simply show an interim value in the about page until next validation, at which time the expiry will likely have been set.