Skip to content

Reference

OpcUserNameAcl Members

Represents the access control list of an OpcServerSecurity which authenticates user name identity tokens using the OpcServerIdentity instances of its entries.

Reference

OpcUserNameAcl Members ​

Type
OpcUserNameAcl
Namespace
Opc.UaFx.Server
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Inherits members from OpcAccessControlList.

Constructors ​

OpcUserNameAcl ​

since v2.6

Initializes a new instance of the OpcUserNameAcl class using the owner specified.

csharp
public OpcUserNameAcl(OpcServerBase owner)
vbnet
Public Sub New(owner As OpcServerBase)

Parameters

NameTypeDescription
ownerOpcServerBaseThe OpcServerBase the list belongs to.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe owner is a null reference (Nothing in Visual Basic).

Remarks

The entries created by the list evaluate operations and endpoints using the mode Whitelist.

Properties ​

TokenType ​

protected · override · since v2.42

Gets the type of the identity tokens the list is responsible for.

csharp
protected override OpcAccessControlTokenType TokenType { get; }
vbnet
Protected Overrides ReadOnly Property TokenType As OpcAccessControlTokenType

Property value

OpcAccessControlTokenType

Always UserName.

Overrides

TokenType

Methods ​

AddEntry ​

9 overloads

OverloadDescription
AddEntry(string, string)Adds an entry for a user with the userName and password specified.
AddEntry(string, byte[])Adds an entry for a user with the userName and password specified.
AddEntry(string, string, OpcAccessControlMode)Adds an entry for a user with the userName and password specified using the operationAccessMode specified.
AddEntry(string, byte[], OpcAccessControlMode)Adds an entry for a user with the userName and password specified using the operationAccessMode specified.
AddEntry(string, string, OpcAccessControlMode, OpcAccessControlMode)Adds an entry for a user with the userName and password specified using the operationAccessMode and endpointAccessMode specified.
AddEntry(string, byte[], OpcAccessControlMode, OpcAccessControlMode)Adds an entry for a user with the userName and password specified using the operationAccessMode and endpointAccessMode specified.
AddEntry(OpcServerIdentity)since v2.7Adds an entry for the identity specified.
AddEntry(OpcServerIdentity, OpcAccessControlMode)since v2.7Adds an entry for the identity specified using the operationAccessMode specified.
AddEntry(OpcServerIdentity, OpcAccessControlMode, OpcAccessControlMode)since v2.7Adds an entry for the identity specified using the operationAccessMode and endpointAccessMode specified.

AddEntry(string, string) ​

Adds an entry for a user with the userName and password specified.

csharp
public OpcAccessControlEntry AddEntry(string userName, string password)
vbnet
Public Function AddEntry(
    userName As String,
    password As String) As OpcAccessControlEntry

Parameters

NameTypeDescription
userNameStringThe name of the user.
passwordStringThe password of the user.

Returns

OpcAccessControlEntry

The new OpcAccessControlEntry of the user.

Exceptions

ExceptionCondition
ArgumentExceptionThe userName is equals Empty.
ArgumentNullExceptionThe userName or password is a null reference (Nothing in Visual Basic).

Remarks

The entry uses the OperationAccessMode and the EndpointAccessMode of the list. Each call adds a new entry, also for a user name which is already used by another entry; Authenticate uses the first matching entry.

AddEntry(string, byte[]) ​

Adds an entry for a user with the userName and password specified.

csharp
public OpcAccessControlEntry AddEntry(string userName, byte[] password)
vbnet
Public Function AddEntry(
    userName As String,
    password As Byte()) As OpcAccessControlEntry

Parameters

NameTypeDescription
userNameStringThe name of the user.
passwordByte[]The bytes of the password of the user, which need to equal the result of TransformPassword for the password a client provides; by default these are the bytes of the password encoded using UTF-16 (little endian).

Returns

OpcAccessControlEntry

The new OpcAccessControlEntry of the user.

Exceptions

ExceptionCondition
ArgumentExceptionThe userName is equals Empty.
ArgumentNullExceptionThe userName or password is a null reference (Nothing in Visual Basic).

Remarks

The entry uses the OperationAccessMode and the EndpointAccessMode of the list. Each call adds a new entry, also for a user name which is already used by another entry; Authenticate uses the first matching entry.

AddEntry(string, string, OpcAccessControlMode) ​

Adds an entry for a user with the userName and password specified using the operationAccessMode specified.

csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    string password,
    OpcAccessControlMode operationAccessMode)
vbnet
Public Function AddEntry(
    userName As String,
    password As String,
    operationAccessMode As OpcAccessControlMode) As OpcAccessControlEntry

Parameters

NameTypeDescription
userNameStringThe name of the user.
passwordStringThe password of the user.
operationAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly.

Returns

OpcAccessControlEntry

The new OpcAccessControlEntry of the user.

Exceptions

ExceptionCondition
ArgumentExceptionThe userName is equals Empty.
ArgumentNullExceptionThe userName or password is a null reference (Nothing in Visual Basic).

Remarks

The entry uses the EndpointAccessMode of the list. Each call adds a new entry, also for a user name which is already used by another entry; Authenticate uses the first matching entry.

AddEntry(string, byte[], OpcAccessControlMode) ​

Adds an entry for a user with the userName and password specified using the operationAccessMode specified.

csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    byte[] password,
    OpcAccessControlMode operationAccessMode)
vbnet
Public Function AddEntry(
    userName As String,
    password As Byte(),
    operationAccessMode As OpcAccessControlMode) As OpcAccessControlEntry

Parameters

NameTypeDescription
userNameStringThe name of the user.
passwordByte[]The bytes of the password of the user, which need to equal the result of TransformPassword for the password a client provides; by default these are the bytes of the password encoded using UTF-16 (little endian).
operationAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly.

Returns

OpcAccessControlEntry

The new OpcAccessControlEntry of the user.

Exceptions

ExceptionCondition
ArgumentExceptionThe userName is equals Empty.
ArgumentNullExceptionThe userName or password is a null reference (Nothing in Visual Basic).

Remarks

The entry uses the EndpointAccessMode of the list. Each call adds a new entry, also for a user name which is already used by another entry; Authenticate uses the first matching entry.

AddEntry(string, string, OpcAccessControlMode, OpcAccessControlMode) ​

Adds an entry for a user with the userName and password specified using the operationAccessMode and endpointAccessMode specified.

csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    string password,
    OpcAccessControlMode operationAccessMode,
    OpcAccessControlMode endpointAccessMode)
vbnet
Public Function AddEntry(
    userName As String,
    password As String,
    operationAccessMode As OpcAccessControlMode,
    endpointAccessMode As OpcAccessControlMode) As OpcAccessControlEntry

Parameters

NameTypeDescription
userNameStringThe name of the user.
passwordStringThe password of the user.
operationAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly.
endpointAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how the entry evaluates an endpoint which has neither been enabled nor disabled explicitly.

Returns

OpcAccessControlEntry

The new OpcAccessControlEntry of the user.

Exceptions

ExceptionCondition
ArgumentExceptionThe userName is equals Empty.
ArgumentNullExceptionThe userName or password is a null reference (Nothing in Visual Basic).

Remarks

Each call adds a new entry, also for a user name which is already used by another entry; Authenticate uses the first matching entry.

AddEntry(string, byte[], OpcAccessControlMode, OpcAccessControlMode) ​

Adds an entry for a user with the userName and password specified using the operationAccessMode and endpointAccessMode specified.

csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    byte[] password,
    OpcAccessControlMode operationAccessMode,
    OpcAccessControlMode endpointAccessMode)
vbnet
Public Function AddEntry(
    userName As String,
    password As Byte(),
    operationAccessMode As OpcAccessControlMode,
    endpointAccessMode As OpcAccessControlMode) As OpcAccessControlEntry

Parameters

NameTypeDescription
userNameStringThe name of the user.
passwordByte[]The bytes of the password of the user, which need to equal the result of TransformPassword for the password a client provides; by default these are the bytes of the password encoded using UTF-16 (little endian).
operationAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly.
endpointAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how the entry evaluates an endpoint which has neither been enabled nor disabled explicitly.

Returns

OpcAccessControlEntry

The new OpcAccessControlEntry of the user.

Exceptions

ExceptionCondition
ArgumentExceptionThe userName is equals Empty.
ArgumentNullExceptionThe userName or password is a null reference (Nothing in Visual Basic).

Remarks

Each call adds a new entry, also for a user name which is already used by another entry; Authenticate uses the first matching entry.

AddEntry(OpcServerIdentity) ​

since v2.7

Adds an entry for the identity specified.

csharp
public OpcAccessControlEntry AddEntry(OpcServerIdentity identity)
vbnet
Public Function AddEntry(identity As OpcServerIdentity) As OpcAccessControlEntry

Parameters

NameTypeDescription
identityOpcServerIdentityThe OpcServerIdentity of the user.

Returns

OpcAccessControlEntry

The OpcAccessControlEntry of the identity.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe identity is a null reference (Nothing in Visual Basic).

Remarks

A new entry uses the OperationAccessMode and the EndpointAccessMode of the list. If the list already contains an entry for the identity, that entry is returned unchanged.

AddEntry(OpcServerIdentity, OpcAccessControlMode) ​

since v2.7

Adds an entry for the identity specified using the operationAccessMode specified.

csharp
public OpcAccessControlEntry AddEntry(
    OpcServerIdentity identity,
    OpcAccessControlMode operationAccessMode)
vbnet
Public Function AddEntry(
    identity As OpcServerIdentity,
    operationAccessMode As OpcAccessControlMode) As OpcAccessControlEntry

Parameters

NameTypeDescription
identityOpcServerIdentityThe OpcServerIdentity of the user.
operationAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how a new entry evaluates an operation which has neither been allowed nor denied explicitly.

Returns

OpcAccessControlEntry

The OpcAccessControlEntry of the identity.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe identity is a null reference (Nothing in Visual Basic).

Remarks

A new entry uses the EndpointAccessMode of the list. If the list already contains an entry for the identity, that entry is returned unchanged, also if it uses another mode.

AddEntry(OpcServerIdentity, OpcAccessControlMode, OpcAccessControlMode) ​

since v2.7

Adds an entry for the identity specified using the operationAccessMode and endpointAccessMode specified.

csharp
public OpcAccessControlEntry AddEntry(
    OpcServerIdentity identity,
    OpcAccessControlMode operationAccessMode,
    OpcAccessControlMode endpointAccessMode)
vbnet
Public Function AddEntry(
    identity As OpcServerIdentity,
    operationAccessMode As OpcAccessControlMode,
    endpointAccessMode As OpcAccessControlMode) As OpcAccessControlEntry

Parameters

NameTypeDescription
identityOpcServerIdentityThe OpcServerIdentity of the user.
operationAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how a new entry evaluates an operation which has neither been allowed nor denied explicitly.
endpointAccessModeOpcAccessControlModeOne of the members defined by the OpcAccessControlMode enumeration which specifies how a new entry evaluates an endpoint which has neither been enabled nor disabled explicitly.

Returns

OpcAccessControlEntry

The OpcAccessControlEntry of the identity.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe identity is a null reference (Nothing in Visual Basic).

Remarks

If the list already contains an entry for the identity, that entry is returned unchanged, also if it uses other modes.

Authenticate ​

override · since v2.42

Authenticates the identityToken specified if it is a user name identity token which matches the OpcServerIdentity of an entry.

csharp
public override OpcPrincipal Authenticate(OpcIdentityToken identityToken)
vbnet
Public Overrides Function Authenticate(
    identityToken As OpcIdentityToken) As OpcPrincipal

Parameters

NameTypeDescription
identityTokenOpcIdentityTokenThe OpcIdentityToken to authenticate.

Returns

OpcPrincipal

The OpcPrincipal of the first entry whose identity matches the user name and password of the identityToken (see Matches); otherwise a null reference (Nothing in Visual Basic).

Exceptions

ExceptionCondition
OpcExceptionThe user name and password of the identityToken cannot be compared with an entry, for example because the token provides no password; the exception states BadIdentityTokenRejected.

Overrides

Authenticate

Remarks

An authenticated principal is assigned to the role AuthenticatedUser.