Several SLASCONE API endpoints return a LicenseInfoDto or LicenseDto containing license validation fields.
The most important field is is_valid. It represents the overall validation result from the client application's perspective.
In most scenarios, the client application should allow usage only if is_valid == true. If is_valid == false, date_validity should usually be checked first to identify date-related reasons. If the license is valid from a date perspective, is_active can then explain whether the license was explicitly deactivated.
RECOMMENDED VALIDATION ORDER
Client applications should evaluate license validation fields in the following order:
Check
is_valid. Ifis_valid == true, the license is valid and the client application can allow usage.If
is_valid == false, checkdate_validityto determine whether the license is not yet valid or has expired.If
date_validity == 0, the license is valid from a date perspective. In that case, checkis_activeto determine whether the license has been explicitly deactivated.
In other words, is_valid is the overall result. The fields date_validity and is_active help explain why is_valid is false.
IS_VALID
The field is_valid represents the overall license validity from the client application's perspective.
A license is only valid if all relevant validation conditions are fulfilled. This includes activation status, date validity, and other license-related validation rules.
| Value | Meaning | Typical client behavior |
|---|---|---|
true | The license is currently valid. | The client application can allow usage. |
false | The license is currently not valid. | The client application should block usage or show an appropriate message. |
WHY IS_VALID CAN BE FALSE
If is_valid == false, the client application can inspect the supporting validation fields to determine the reason.
DATE-RELATED REASONS
The field date_validity explains whether the license is valid from a date perspective.
| Value | Meaning | Description |
|---|---|---|
0 | Valid | The current date is within the valid date range. |
1 | Not yet valid | The start date lies in the future. |
2 | Expired | The license has passed its expiration date. |
If date_validity == 1, the license is not yet valid because the configured start date lies in the future. In this case, the license may already be active, but it should not yet be used by the client application.
| Field | Value | Meaning |
|---|---|---|
is_valid | false | The license is not currently valid. |
date_validity | 1 | The license start date is in the future. |
is_active | true or false | Not relevant for the allow/block decision because the license is not yet valid from a date perspective. |
If date_validity == 2, the license has expired from a date validity perspective.
| Field | Value | Meaning |
|---|---|---|
is_valid | false | The license is not currently valid. |
date_validity | 2 | The license date range has expired. |
is_active | false | Not relevant for the allow/block decision because the license is expired from a date perspective. |
EXPLICIT DEACTIVATION
If is_valid == false and no date-related issue was detected (date_validity == 0), check is_active. If is_active == false, the license has been explicitly deactivated or is not active according to the licensing flow.
| Field | Value | Meaning |
|---|---|---|
is_valid | false | The license is not valid. |
date_validity | 0 | The license is valid from a date perspective. |
is_active | false | The license is not active. |
EXAMPLE SCENARIOS
VALID LICENSE
If all relevant validation conditions are fulfilled, is_valid is true.
| Field | Value | Meaning |
|---|---|---|
is_valid | true | The license is valid. |
date_validity | 0 | The current date is within the valid date range. |
is_active | true | The license is active. |
STARTS IN THE FUTURE
A license can be active while still not being valid yet. This can happen when the license has a start date in the future.
| Field | Value | Meaning |
|---|---|---|
is_valid | false | The license is not currently valid. |
date_validity | 1 | The license start date is in the future. |
is_active | true or false | Not relevant for the allow/block decision because the license is not yet valid from a date perspective. |
EXPIRED
A license can be active but no longer valid because the date range has expired.
| Field | Value | Meaning |
|---|---|---|
is_valid | false | The license is not currently valid. |
date_validity | 2 | The license date range has expired. |
is_active | false | Not relevant for the allow/block decision because the license is expired from a date perspective. |
DEACTIVATED
If a license was explicitly deactivated, is_valid is false, even if the date validity is otherwise valid.
| Field | Value | Meaning |
|---|---|---|
is_valid | false | The license is not valid. |
date_validity | 0 | The license is valid from a date perspective. |
is_active | false | The license is not active. |
Comments
0 comments
Article is closed for comments.