FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
08-02-2021 02:39 PM
Hi Community,
i am wondering what the proper way is, to implement a license check in my app.
The License check should be able to check if a user/customer has the right license for the app. Only then it should start the installation.
Can anybody help me on this or provide a good example?
Here is a basic approach:
#POST request. Check for license
curl --location --request POST 'https://host/license-manager/api/v2/license'
# Condition
if [[ "$GET_RESPONSE" -ne 200 && $IsPermanent == true]] ; then
echo "Start App installation"
else
echo "Stop App installation. No License available"
exit 0
Solved! Go to Solution.
08-03-2021 01:54 PM - edited 10-22-2021 09:24 AM
As far as I know the installation is normally not be prohibited by the licence. You should check while the boot up of your code if the license is valid or not and decide if to stop the function. See Developer Guideline for more information.
There are two ways to get the information:
1) Open API:
see API description your ctrlX CORE "https://<IP of your control>/doc/api/license-manager/#/Licenses/acquireLicens:
2) Unix Sockets:
plugs:
...
# Bosch Rexroth licensing service.
licensing-service:
interface: content
content: licensing-service
target: $SNAP_DATA/licensing-service
apps:
# Make runtime connect accessible.
runtime:
command: connect
plugs:
- licensing-service
unixSocket = "$SNAP_DATA/licensing-service/licensing-service.sock";
10-22-2021 09:21 AM
Updated post above.