CodeSys OPC UA connection not possible - Error: BadUserAccessDenied

Post Reply
johan.vdw
Posts: 1
Joined: 15 Mar 2023, 09:50
Answers: 0

CodeSys OPC UA connection not possible - Error: BadUserAccessDenied

Post by johan.vdw »

Good day,

I have a Connect+ device running paid license of CodeSys MC SL.
I’ve been trying to configure an OPC UA server for anonymous access. (User access with password has also not worked...)
I’ve followed suggestions on different forums (including this forum) but I’m still not able to establish a connection with the server using UaExpert or Node-RED.

The error I receive on UaExpert is:
09:36:10.941 | Server Node | OPCUAServer@RevPi87022 | Used UserTokenType: Anonymous
09:36:10.979 | Server Node | OPCUAServer@RevPi87022 | Error 'BadUserAccessDenied' was returned during ActivateSession
09:36:10.983 | Server Node | OPCUAServer@RevPi87022 | Connection status of server 'OPCUAServer@RevPi87022' changed to 'Disconnected'.
Thus far I’ve disabled the User Management on Codesys and allowed for Anonymous access via the Codesys Runtime security. (https://faq.codesys.com/display/CDSFAQ/ ... mous+login)
I’ve also allowed the certificates for connections via UaExpert and Node-RED (following these instructions: https://help.codesys.com/api-content/2/ ... ua_server/)

I also tried changing the Codesys config files based on the suggestions listed here:
https://forge.codesys.com/forge/talk/En ... 3a0b4a227/

Any help with the issue would be greatly appreciated!!!
u.biakoup
KUNBUS
Posts: 182
Joined: 14 Apr 2022, 13:04
Answers: 2

Re: CodeSys OPC UA connection not possible - Error: BadUserAccessDenied

Post by u.biakoup »

Hello Johan.vdw,

The error you have on UaExpert is due to the configuration on your server side. You are running OPCUA Server in codesys.
Please have a look at this OPCUA&CODESYS webinar.
you can also post your problem on Codesys forum.

Best Regards

Ulrich Kouatang Biakoup | Technical Support
User avatar
wawa316
Posts: 2
Joined: 09 Jan 2024, 17:16
Answers: 0

Re: CodeSys OPC UA connection not possible - Error: BadUserAccessDenied

Post by wawa316 »

Hello.
It was never possible to fully set up the connection between Raspberry and UA Expert.
Communication works only with AnonymousLogin and without encryption.
If Login/Password is enabled or if encryption is enabled, then nothing happens. :(
But in the PLC_Win3*64 controller there is no way to disable Login/Password and therefore the connection is not configured at all.
Therefore, I see one solution here: use a VPN, do not use Login/Password and do not use encryption.

Has anyone managed to do this correctly?
Thank you.
User avatar
wawa316
Posts: 2
Joined: 09 Jan 2024, 17:16
Answers: 0

Re: CodeSys OPC UA connection not possible - Error: BadUserAccessDenied

Post by wawa316 »

wawa316 wrote: 09 Jan 2024, 17:34 Hello.
It was never possible to fully set up the connection between Raspberry and UA Expert.
Communication works only with AnonymousLogin and without encryption.
If Login/Password is enabled or if encryption is enabled, then nothing happens. :(
But in the PLC_Win3*64 controller there is no way to disable Login/Password and therefore the connection is not configured at all.
Therefore, I see one solution here: use a VPN, do not use Login/Password and do not use encryption.

Has anyone managed to do this correctly?
Thank you.
I found a solution: you need to include the certificate from the UA Expert in the trusted certificates in the CoDeSys environment.
More information about this is written here: https://help.codesys.com/api-content/2/ ... ua_server/
See point 7.
Encrypted connection with authentication now works well.
Post Reply