hello, I state that I have just started to study the operation of the OPC-UA architecture and that I am not an expert programmer, what I would like to do is communicate with an OPC-UA server of a Modicon M241 PLC from an application in Unity3D. In order to activate session into the server I had to make a change to your library to make a username/password connection but with a plaintext password (without encryption). The PLC server is not otherwise configurable. Among the methods in your library there is no such choice
The new class is:
public class UserIdentityUsernamePlainPasswordToken
{
public string PolicyId { get; protected set; }
public string Username { get; protected set; }
public string Password { get; protected set; }
public UserIdentityUsernamePlainPasswordToken(string PolicyId, string Username, string Password)
{
this.PolicyId = PolicyId;
this.Username = Username;
this.Password = Password;
}
}
inside ActivateSession method:
...
if (identityToken is UserIdentityUsernamePlainPasswordToken)
{
succeeded &= sendBuf.Encode(new NodeId(UAConst.UserNameIdentityToken_Encoding_DefaultBinary));
succeeded &= sendBuf.Encode((byte)1);
int eoStartPos = sendBuf.Position;
succeeded &= sendBuf.Encode((UInt32)0);
succeeded &= sendBuf.EncodeUAString(((identityToken as UserIdentityUsernamePlainPasswordToken)).PolicyId);
succeeded &= sendBuf.EncodeUAString(((identityToken as UserIdentityUsernamePlainPasswordToken)).Username);
succeeded &= sendBuf.EncodeUAString(((identityToken as UserIdentityUsernamePlainPasswordToken)).Password);
succeeded &= sendBuf.EncodeUAString((string)null);
succeeded &= sendBuf.Encode((UInt32)(sendBuf.Position - eoStartPos - 4), eoStartPos);
}
...
hello, I state that I have just started to study the operation of the OPC-UA architecture and that I am not an expert programmer, what I would like to do is communicate with an OPC-UA server of a Modicon M241 PLC from an application in Unity3D. In order to activate session into the server I had to make a change to your library to make a username/password connection but with a plaintext password (without encryption). The PLC server is not otherwise configurable. Among the methods in your library there is no such choice
The new class is:
inside ActivateSession method:
and using method: