We do our licensing by contract dates rather than by duration. We are hoping to be able to create licenses that start on a particular date and expire on a particular date. We don’t want to have to give our customers a new key every year so we’d like to renew licenses by PATCHing the expiry date.
I currently see these problems:
- We can’t specify an expiry date, we must calculate a number of seconds of validity that will hopefully end on the correct date.
- The validity period cannot be changed once the license is created.
- License renewal can only extend an existing license by the original validity period. This makes the new expiry date difficult to control.
I wonder if anybody else wants to use dates, or has already figured out a tidy workaround.
Hi Gary,
Validity is used for two purposes:
1- To calculate the expiry date when the license is created
2- As an offset when the license is renewed to calculate the new expiration date.
Validity is just the offset, not the expiration date. You can change the expiration date to any future or past date using the “Extend” option wherein you can specify your own offset (positive or negative) to adjust the expiration date of the license.
We are planning to add a date picker to the “Extend License” dialog, so that you specify the date and it automatically calculates the duration in the dashboard before sending the request to the server.
Thanks Adnan.
A dashboard date picker won’t help us much because we’ll normally be making licenses via the web API. However, now that you have pointed me in the right direction, I see that we can GET the license for its expiresAt date, calculate the difference in seconds between that and the new expiry date, and POST an extend request. It would still be nicer if extend could optionally be given a new expiresAt date instead of the extensionLength value so that we don’t have to do the calculations, but it’s not a showstopper.
Gary
We will look into feasibility. We can let the server calculate the extensionLength from the expiration date instead of asking it from the user.