Replies: 2 comments
-
Try setting the authType to UserName. This should work if the server is accepting username authentication.
"ep" is the endpointDescription returned from the SelectEndpoint method |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi,
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Everyone,
I would like to ask for help with authentication to OPC UA server using username and password.
Below snip of my code how I am creating opc client.
username := "user"
password := "password"
opts := []opcua.Option{
opcua.SecurityMode(ua.MessageSecurityModeNone),
opcua.AuthUsername(username, password),
opcua.AutoReconnect(true),
}
ctx := context.Background()
c, _ := opcua.NewClient(opc.tcp://172.17.0.5:4840", opts...)
but I receive error:
Failed to connect to OPC UA server: The user identity token is not valid. StatusBadIdentityTokenInvalid (0x80200000)
When I switch to anonymous mode I can connect and read values, but not at all with password and username. Others clients (written in python or UAExpert) is working fine.
Thank you for help!
Beta Was this translation helpful? Give feedback.
All reactions