- Posts: 11
- Thank you received: 0
Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
- Forum
- Discussions
- QuickOPC-UA in .NET
- Connections, Reconnections, Certificates
- OPC UA - User Name with backslash (\)
OPC UA - User Name with backslash (\)
Thank you for your support. I works directly with: Dim endpoint As UAEndpointDescriptor = New UAEndpointDescriptor(OPCServer).WithUserNameIdentity(UserName, Password)
Please Log in or Create an account to join the conversation.
one such example is here: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...nregister%20all%20clients.html
And you can put a backslash into the user name and will stay there. Just do not try to get it back from UAEndpointDescriptor.UserName, because that is a different thing.
If you really want to check that the the backslash "stays" there, you need to check UAEndpointDescriptor.UserIdentity.UserNameTokenInfo.UserName.
Best regards
Please Log in or Create an account to join the conversation.
endpoint.UserName = UserName
endpoint.Password = Password
Please Log in or Create an account to join the conversation.
Best Regards
Please Log in or Create an account to join the conversation.
I am sorry but I don't follow you. I attach all my code:
Dim UserName As String = "user1"
Dim Password As String = "pass1"
If EasyUAClient Is Nothing Then InitUA()
Dim HandleID As Integer = 0
Dim item As OpcLabs.EasyOpc.UA.OperationModel.EasyUAMonitoredItemArguments
Value = Nothing
If (String.IsNullOrEmpty(UserName)) Then
item = New OpcLabs.EasyOpc.UA.OperationModel.EasyUAMonitoredItemArguments(OPCServer & OPCTag, OPCServer, OPCTag, New UAMonitoringParameters(Optional_OPCRequestedUpdateRate))
Else
Dim endpoint As UAEndpointDescriptor = New UAEndpointDescriptor(OPCServer).WithUserNameIdentity(UserName, Password)
endpoint.UserName = UserName
endpoint.Password = Password
item = New OpcLabs.EasyOpc.UA.OperationModel.EasyUAMonitoredItemArguments(OPCServer & OPCTag, OPCServer, OPCTag, New UAMonitoringParameters(Optional_OPCRequestedUpdateRate))
item.EndpointDescriptor = endpoint
End If
HandleID = EasyUAClient.SubscribeMonitoredItem(item)
Return HandleID
They line in bold should be changed you mean?
Thank you in advance.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The code is done by vb.net.
If I use the following expresion:
UAEndpointDescriptorExtension.WithUserNameIdentity(New OpcLabs.EasyOpc.UA.UAEndpointDescriptor(OPCServer), UserName, Password)
I receive the same result.
Which function should I use in orden to identify?
The code work properly if there is not a backslash in the UserName.
Best Regards,
Please Log in or Create an account to join the conversation.
More:
You seem to be mixing two things, although the code seem to be incomplete. The WithUserNameIdentity extension method would be the right approach.
Setting UserName and Password directly on UAEndpointDescriptor is *not* the right approach, so trying to resolve why it behaves the way it behaves with the backslash is pointless. So you can just leave out these parts.
Best regards
Please Log in or Create an account to join the conversation.
We use the following code:
Dim uAEndpointDescriptor As OpcLabs.EasyOpc.UA.UAEndpointDescriptor = UAEndpointDescriptorExtension.WithUserNameIdentity(New OpcLabs.EasyOpc.UA.UAEndpointDescriptor(OPCServer), UserName, Password)
uAEndpointDescriptor.set_UserName(UserName)
uAEndpointDescriptor.set_Password(Password)
LogTXT(String.Format("+++++++++ endpoint.UserName: {0} - endpoint.Password: {1} - endpoint.Port: {2}", uAEndpointDescriptor.get_UserName(), uAEndpointDescriptor.get_Password(), uAEndpointDescriptor.get_Port()), False, "")
IF We use the following user and password
USER: name\user
Password: 1234
We get the following data:
+++++++++ endpoint.UserName: - endpoint.Password: 1234 - endpoint.Port: -1
IF We use the following user and password
USER: nameanduser
Password: 1234
We get the following data:
+++++++++ endpoint.UserName: nameanduser - endpoint.Password: 1234 - endpoint.Port: 65300
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-UA in .NET
- Connections, Reconnections, Certificates
- OPC UA - User Name with backslash (\)