How to get the license id by **LexActivator** library

Hi, all

I added LexActivator library to my application written in C++.
I need to get the license id by using LexActivator library.

I found GetLicenseKey() to get the license key, but I didn’t find any API to get the license id.
Please let me know how to get the license id by LexActivator library.


Hi Jimmy

Can you please mention your use case?

Thanks for your reply.

My application consists of two parts: backend (c++), frontend (web).
The users manage the licenses via frontend and the frontend communicates with backend when activating those licenses.
Because the frontend doesn’t store the license, it needs to get the license id from the backend for getting license information from the cryptlex.

That’s all.

LexActivator is meant for Desktop based apps, and not for the single backend server. You typically have a single backend for all your customers, and only one license key can be activated using LexActivator in a single system for a product.

The only time you will use LexActivator for your backend app, is when you sell the backend itself, and each customer installs the backend on a different machine, which LexActivator will fingerprint and activate the license.

You cannot use protected Web API endpoints from the client-facing apps, as they require an access token. If someone gets access to your personal access tokens, your data gets compromised.

In your use case, you have to activate the frontend app, which can be done using Web API. You can use activation public API endpoints to create/update the activation and they return all the license data you need.

Refer to the following:

In our application, the backend is main.
We’re going to sell our backend to our customers.
Is there any solution to get the license id in backend?

Because the frontend has to use the Cryptlex Web API for managing licenses, it needs to get the id of the relevant license from the backend.

Please help.

When you create a license make sure you link the user with license.

First, use the email and password of the user (customer) to get an access token using the following API endpoint:

This will return an access token, which can be used to get the license key of the user using the following API endpoint:

Once you get the license key, then the flow is the same as in any app. Use the license key to activate the license.

So, essentially you fetched the license key of the user in the background and used it for activation.

What I need to get isn’t the license key, and it’s the license id .
I’d like to use LexActivator to get the license id.
Is it possible?

In order to get license details using the license id, you need access token and you can’t embed access token in your C++ app.

LexActivator already gives you almost all the needed license details.

Thanks for your reply.

But I can’t find that API in LexActivator.
Please let me know the LexActivator API to get the license id.

What license information do you need in your app which LexActivator doesn’t provide?

I need the license ID of the given license key (for example, the id of activated license key).

You don’t need license id because it is needed if you want to access license data through the Web API, and it requires access token which you can’t use in your web app.

LexActivator already provides function to the license data you would typically need (e.g. GetLicenseExpiryDate, GetLicenseMetadata etc.), which you want to fetch through license id using web api.

I need to get the license information in the frontend.
This frontend gets the license id from the backend, because only the backend knows the activated license.

But your frontend will require access token to use license id get this info, how will you get the access token in your frontend app?

I’m going to use the following Web API when using the license id:

Please read the following, license id is not enough to get the details through web api: