Reference
OpcServerIdentity Members
Represents the identity of a user of the server, which is identified by a user name and a password.
Reference
OpcServerIdentity Members
- Type
- OpcServerIdentity
- Namespace
- Opc.UaFx.Server
- Assembly
- Opc.UaFx.Advanced.dll
- Package
- Opc.UaFx.Advanced v2.59.0
Inherits members from OpcUserIdentity, OpcIdentity.
Constructors
OpcServerIdentity
| Overload | Description |
|---|---|
| Opc | Initializes a new instance of the OpcuserName specified and an empty password. |
| Opc | Initializes a new instance of the OpcuserName and password specified. |
| Opc | Initializes a new instance of the OpcuserName and password specified. |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Argument | The userName is equals Empty. |
OpcServerIdentity(string)
Initializes a new instance of the OpcServerIdentity class using the userName specified and an empty password.
public OpcServerIdentity(string userName)Public Sub New(userName As String)Parameters
| Name | Type | Description |
|---|---|---|
userName | String | The name of the user. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The userName is a null reference ( |
OpcServerIdentity(string, string)
Initializes a new instance of the OpcServerIdentity class using the userName and password specified.
public OpcServerIdentity(string userName, string password)Public Sub New(userName As String, password As String)Parameters
| Name | Type | Description |
|---|---|---|
userName | String | The name of the user. |
password | String | The password of the user, which is stored as transformed by Transform |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The userName or password is a null reference ( |
Remarks
The constructor calls the virtual method TransformPassword, so that an override in a derived class is called before the constructor of the derived class has initialized the instance.
OpcServerIdentity(string, byte[])
Initializes a new instance of the OpcServerIdentity class using the userName and password specified.
public OpcServerIdentity(string userName, byte[] password)Public Sub New(userName As String, password As Byte())Parameters
| Name | Type | Description |
|---|---|---|
userName | String | The name of the user. |
password | Byte[] | The bytes of the password of the user, which need to equal the result of Transform |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The userName or password is a null reference ( |
Remarks
The password is stored without being copied, so that later changes of the array change the password of the identity.
Properties
DisplayName
Gets the name displayed for the identity.
public override string DisplayName { get; }Public Overrides ReadOnly Property DisplayName As StringProperty value
The UserName of the identity.
Overrides
UserName
Gets the name of the user.
public string UserName { get; }Public ReadOnly Property UserName As StringProperty value
The user name specified on construction.
Methods
ChangePassword
| Overload | Description |
|---|---|
| ChangePassword( | Changes the password of the identity to the password specified. |
| ChangePassword( | Changes the password of the identity to the bytes specified by password. |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Argument | The password is a null reference ( |
ChangePassword(string)
Changes the password of the identity to the password specified.
public void ChangePassword(string password)Public Sub ChangePassword(password As String)Parameters
| Name | Type | Description |
|---|---|---|
password | String | The new password of the user, which is stored as transformed by Transform |
ChangePassword(byte[])
Changes the password of the identity to the bytes specified by password.
public void ChangePassword(byte[] password)Public Sub ChangePassword(password As Byte())Parameters
| Name | Type | Description |
|---|---|---|
password | Byte[] | The bytes of the new password of the user, which need to equal the result of Transform |
Remarks
The bytes are copied.
Impersonate
Returns an impersonation context for the identity.
public override OpcImpersonationContext Impersonate()Public Overrides Function Impersonate() As OpcImpersonationContextReturns
An instance of the OpcDefaultImpersonationContext class, which does not impersonate the user.
Overrides
Matches
Determines whether the userName and password specified match the identity.
public virtual bool Matches(string userName, string password)Public Overridable Function Matches(
userName As String,
password As String) As BooleanParameters
| Name | Type | Description |
|---|---|---|
userName | String | The user name to compare. |
password | String | The password to compare. |
Returns
The value true if the userName equals the UserName (case-sensitive) and the result of TransformPassword for the password equals the password of the identity; otherwise the value false.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The userName is equals Empty. |
| Argument | The userName or password is a null reference ( |
Remarks
The passwords are compared in constant time.
TransformPassword
Transforms the password specified into the bytes stored and compared by the identity.
protected virtual byte[] TransformPassword(string password)Protected Overridable Function TransformPassword(password As String) As Byte()Parameters
| Name | Type | Description |
|---|---|---|
password | String | The password to transform. |
Returns
Byte[]
The bytes of the password. The base implementation returns the password encoded using UTF-16 (little endian) (see Unicode).
Remarks
The method is also called by the constructor OpcServerIdentity.

