After using the security examples for using authenticationhttp://documentation.unified-automation ... ation.html,
I would like to use the PAM library to authenticate login users from the Linux service itself, instead of (re)defining my login credentials.
Unfortunately, the program crashes inside the following build-in SDK method:
Code: Select all
UaServer_SetUserAuthenticationTypeEx(&uaServer, UserAuthType_PAM, OpcUa_Null);
I've also linked the PAM lib to the program, and tested the lib individually without any issue.
This the code from which I am using in order to activate the PAM authentication:
Code: Select all
/* Set the endpoint configuration to use Username/Password logon */
pEndpoint->uNoOfUserTokenPolicy = 1;
pEndpoint->pUserTokenPolicy = OpcUa_Alloc(pEndpoint->uNoOfUserTokenPolicy * sizeof(OpcUa_UserTokenPolicy));
OpcUa_UserTokenPolicy_Initialize(&pEndpoint->pUserTokenPolicy[0]);
pEndpoint->pUserTokenPolicy[0].TokenType = OpcUa_UserTokenType_UserName;
OpcUa_String_AttachReadOnly(&pEndpoint->pUserTokenPolicy[0].PolicyId, "UserName");
OpcUa_String_AttachReadOnly(&pEndpoint->pUserTokenPolicy[0].SecurityPolicyUri, OpcUa_SecurityPolicy_Basic256);
printf("before crash \n");
UaServer_SetUserAuthenticationTypeEx(&uaServer, UserAuthType_PAM, OpcUa_Null);
printf("after crash \n");
I'm using Linux Fedora25 32bit.UA Server: Initializing Stack...
|0x0| 15:09:08.875Z OpcUa_ProxyStub_Initialize: Tracer has been initialized!
|0x0| 15:09:08.875Z OpcUa_ProxyStub_Initialize: Network Module...
|0x0| 15:09:08.875Z OpcUa_ProxyStub_Initialize: Network Module done!
before crash
Segmentation fault (core dumped)
Any suggestion is welcome.
Thanks in advance.