PLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. jbals
  2. PLCnext Store
  3. Monday, 27 January 2020

Is it possible to query something like a license manager service on a PLCnext target to check whether a license exists for an app?

Daniel PLCnext Store Team Accepted Answer Pending Moderation
0
Votes
Undo

This is how you check whether there is a license on your PLCnext Control: Option 1 - Online in the PLCnext Store. Option 2 - Use the WBM >=2020.x
Option 1 - Online in the PLCnext Store:

Lizenz

Option 2 - Use the WBM >=2020.x
LizenzWBM

 

Phoenix Contact Electronics Headquarters - PLCnext Store Team

  1. 3 weeks ago
  2. PLCnext Store
  3. # 1
jbals Accepted Answer Pending Moderation
0
Votes
Undo

Thanks for your reply. But I think these solutions are not usable in my scenario.

I am developing a Java based PLCnext app. Technically its just a JAR which is started via an init.d script through the PLCnext App "runtime environment". During installation of the app, all files of the app will be deployed to the filesystem of the PLCnext target. This means that a user has access to all those files via ssh/scp. So he can just copy the app files to another PLCnext target or any other environment with a Java runtime environment and start the app there.

So it would be quite easy to use the app somewhere else without having a valid license. Because of this I would like to secure the app. For example by calling something like license server from within the app on startup. Do you provide something like this? I think it is a general problem concerning all apps...

  1. 3 weeks ago
  2. PLCnext Store
  3. # 2
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi jbals,

We do indeed provide exactly the solution you describe.

The licence check is done through an RSC service, which is descrbed here:

http://plcnext-infocenter.s3-website.eu-central-1.amazonaws.com/PLCnext_API_Documentation/html/classArp_1_1System_1_1Lm_1_1Services_1_1ILicenseStatusService.html

It is currently possible to use this service from IEC 61131 programs and from C++ components, but I will need to check if we have provided an interface to this service for Java applications - I will let you know.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 3
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi jbals,

I can confirm that the License Status service can be accessed through the Java API for PLCnext Control:

http://plcnext-infocenter.s3-website.eu-central-1.amazonaws.com/PLCnext_Technology_InfoCenter/PLCnext_Technology_InfoCenter/Programming/JAVA/Running_Java_on_a_PLCnext_Control.htm

If you have any more questions on this, please let us know.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 4
jbals Accepted Answer Pending Moderation
0
Votes
Undo

The drawback of the RSC solution is that I need user credentials to access the "remote" services although the app is running directly on the target. So I have to force the user to configure the user credentials in a config file or provide a predefined user with access to the RSC license service. A more convenient solution for me would be to call something directly on the target (like plcnextapp verify-license firmCode productCode). That way the installation could be done without any user interaction.

Anyway... I tried the solution with a dedicated user for the license check via RSC. So I added a new user and set the role "CertificateManager" and tested it, unfortunately the user was not authorized to call the license service. I had to add the admin role.... Is this the desired behavior? Do I really need a user with role "admin" to perform such calls?

  1. 3 weeks ago
  2. PLCnext Store
  3. # 5
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hmm, that's an interesting question. The C++ solution does not require user credentials, and I'm not sure about the IEC solution (although I believe it also does not need user credentials).

I will check with the owner of the Java API.

Another solution may be to call the C++ interface directly ... I know that this is possible in Rust, but I am not familiar with C++ interop in Java - do you think this will be possible?

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 6
jbals Accepted Answer Pending Moderation
0
Votes
Undo

Any news concerning the local RSC connection without user credentials when using the Java API? And what about the user roles? Do I really need the admin role for accessing the license server, in case a user is needed for the connection?

 

  1. 3 weeks ago
  2. PLCnext Store
  3. # 7
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi jbals,

At the moment the Java API always requires user credentials. This may change in future versions, but at the moment I am afraid that is the only option if you're using this API.

I am still trying to find the answer to the question on the user role that's needed.

Again, if using the local C++ interface is an option, then that would avoid this problem.

 ~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 8
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Update: You are correct, a user in the "admin" role is required to use the License Status service through the Java API. This is by design in the current version, but that design is likely to change in a future version of the Java API.

I understand that this makes it difficult for you to deploy your Java app through the PLCnext Store, so I am sorry that there is not a better solution at the moment.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 9
jbals Accepted Answer Pending Moderation
0
Votes
Undo

Are you sure that your proposed solution with the C++ will work  in my case? I found the following documentation:

http://plcnext-infocenter.s3-website.eu-central-1.amazonaws.com/PLCnext_Technology_InfoCenter/PLCnext_Technology_InfoCenter/Programming/Cpp/Cpp-programming.htm

The app would run as a separate programm on the plc next target. It seems to me that there is no access to the RSC...

  1. 3 weeks ago
  2. PLCnext Store
  3. # 10
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Well, your PLCnext Store app could also install a (separate) small Java app that checks the license status via the C++ interface, and makes that information available (somehow) to your daemon. In that case the separate app could be written in any language - C++ is the obvious choice.

This reminds me of another important point: In all cases - even if it was possible to get license status information easily via the Java API - this will not be possible while the PLCnext Runtime is stopped. So, if you want to use the licensing mechanism provided by the PLCnext Store, the correct operation of your daemon will very much depend on the state of the PLCnext Runtime process - if the PLCnext Runtime process is stopped, then your daemon will not work. Perhaps this is OK for you, because your daemon may be relying on the PLCnext Runtime for other things (e.g. data from GDS variables). In this case, then, it might make more sense to design your app as a "runtime" app instead of a daemon (runtime apps are started and stopped with the PLCnext Runtime process). That would make access to RSC services - like the License Status service - somewhat easier.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 11
jbals Accepted Answer Pending Moderation
0
Votes
Undo

Did I get that right? It is possible to build an app that consists of multipe parts (e.g. PLCnext extension and linux daemon)?

  1. 3 weeks ago
  2. PLCnext Store
  3. # 12
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Yes, I believe so.

And also multiple instances of the same type, e.g. two PLCnext Extension components.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 13
jbals Accepted Answer Pending Moderation
0
Votes
Undo

"Believe" sounds like: "You could give it a try."

Is there a roadmap for the JavaSDK? Is it planned to support local RSC use without user credentials?

  1. 3 weeks ago
  2. PLCnext Store
  3. # 14
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

OK, I'll rephrase that - my understanding based on conversations with the PLCnext Store developers is that multiple app types in one container will work. If your particular combination of app types doesn't work, then my understanding will be wrong, at least for your case.

From my conversations with the owner of the Java API, there is currently no roadmap, and it is likely to be some time before there is a version that allows access to RSC services with no user credentials, or for users with less privileged roles.

~ Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 3 weeks ago
  2. PLCnext Store
  3. # 15
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.