#include <OfflineLicenseTokenParser.h>
Service for parsing standalone license tokens.
|
| virtual::tenduke::ee::licensing::Lease | from (const std::string &licenseToken, const std::string &licensedItemName) const=0 |
| | Parses a single token of the given licensed item from given string.
|
| virtual::tenduke::ee::licensing::Lease | from (const std::string &licenseToken) const=0 |
| | Parses a single token from given string, guessing the licensed item name.
|
◆ from() [1/2]
Parses a single token from given string, guessing the licensed item name.
The licensed item name is guessed: it is the only claim with value true, which is not a well-known claim. Prefer from(licenseToken, licensedItemName) for licensing decisions, and always check the name of the returned lease.
- Parameters
-
| licenseToken | the license token |
- Returns
- parsed representation of the license token.
- Exceptions
-
| tenduke::ee::licensing::InvalidLicenseToken | if the string is not a license token, e.g. there is no claim or several claims, which could be the licensed item name |
| tenduke::jwt::JWTParsingException | if the license token is not a proper JWT |
◆ from() [2/2]
Parses a single token of the given licensed item from given string.
Use this for licensing decisions. The license token carries the licensed item name only as a claim "<licensed item name>": true, and the backend signs also other tokens, e.g. ID-tokens, with the same key. The token is accepted only if it has the claim for the given licensed item, with the exact same name.
- Parameters
-
| licenseToken | the license token |
| licensedItemName | name of the licensed item, which the license token must be for |
- Returns
- parsed representation of the license token.
- Exceptions
-
| tenduke::ee::licensing::InvalidLicenseToken | if the string is not a license token of the licensed item |
| tenduke::jwt::JWTParsingException | if the license token is not a proper JWT |
The documentation for this class was generated from the following file: