authentification certification server OPCUA

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
panazol
Jr. Member
Jr. Member
Posts: 3
Joined: 16 Dec 2010, 09:34

authentification certification server OPCUA

Post by panazol »

Good morning

We have been successfully using the Unified Automation Stack since many years to build our OPCUA servers. (OPC UA SDK based on C++)
Until now, we don't use authentication, only anonymous mode (so no access control)

Now, We would like integrate authentication on it by the certificates.
We have, I think, understood the certification mechanism (Configuration in the serverConfig.xml file, the production of keys and certificates and the right folder where the files have to be store (pkiserver in the application folder).

Our first attempts were a failure.
We hadn't seen and now, we think that we have to also add a callback and implement a class to take authentication account in the server implementation.


We have seen the tutorial -->
https://documentation.unified-automation.com/uasdkcpp/1.7.9/html/L2DemoServer.html#L3DemoServer_1

But we can't find myservercallback.h and cpp files (Maybe we deleted them in our distribution by mistake? (Remark : our OPCUA servers have been running since 2014.)
We didn't find these files on Internet

Here , the question:
Can you provide us a complete example of the myservercallback.h and myservercallback.cpp files because the tutorial mentions only few parts.
This class must inherit from a mother class with pure virtual methods define inside , and we have to implement this elements and i think this example file could be of great help to us ?


Thank you for your help.
Regards

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: authentification certification server OPCUA

Post by Support Team »

Hi,

the files myservercallback.{h,cpp} are not part of the SDK. Instead, they are distributed with the delivery as example code and can be found under "examples/server_cpp_demo/myservercallback.{h,cpp}". By their name they imply being not generic.

These Files contain a hard coded example implementation of the UaServerApplicationCallback::logonSessionUser(). Which can also be found on the documentation website you mentioned. The examples on the website are the same as in myservercallback.cpp. So you should not have any trouble using them as source to look at the principal. However, hard coded users, of course, is not a good implementation whatsoever.
This class must inherit from a mother class with pure virtual methods define inside, and we have to implement this elements and i think this example file could be of great help to us?
The UaServerApplicationCallback interface has only two pure virtual methods. One being logonSessionUser. The other one is createSession(). The simplest implementation of this method would be return new UaSession(sessionID, authenticationToken).

The other methods of the Interface have default implementations.
Best regards
Unified Automation Support Team

panazol
Jr. Member
Jr. Member
Posts: 3
Joined: 16 Dec 2010, 09:34

Re: authentification certification server OPCUA

Post by panazol »

Hi
Thank you for the anwer.

We found the informations and the myservercallback files in the "/example" folder. (fine).

However , we think that we have a problem of version of the SDK
we have an old version 1.4.3 version of sdk
and for that raison, we can't use your tutorial and myservercallback files because we have lot of undefined files or methods. lot of change between the 1.4.3 and the version 1.5 for example.

regards
Jean-Luc

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: authentification certification server OPCUA

Post by Support Team »

Hi,

the C++ SDK 1.4.x series has reached End of Live (EoL)
the C++ SDK 1.5.x series has reached End of Live (EoL)
the C++ SDK 1.6.x series has reached End of Live (EoL)

best option you have, i.e. to avoid hundrets of other bugs and security issues, is to update to 1.7.x series.

the C++ SDK 1.7.x series is active mainline. In your case you probably need to migrate step by step.

The "old" 1.4.x series already had the user authentication feature, including the example implementation in the old CppDemoServer as being shipped with the 1.4.3 eight years ago:

https://documentation.unified-automation.com/uasdkcpp/1.4.3/html/L2DemoServer.html#L3DemoServer_1

The C++SDK has evolved over the last 8 years, therefore crosswise copying files of different versions might not be a good idea, however if you run through the example and old documentation, you will quickly get the picture.
Best regards
Unified Automation Support Team

Post Reply