# OpcUserNameAcl Members

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

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcUserNameAcl</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

Inherits members from [OpcAccessControlList](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members).

## Constructors

### OpcUserNameAcl

<span class="api-meta">since v2.6</span>

Initializes a new instance of the [OpcUserNameAcl](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/) class using the `owner` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcUserNameAcl(OpcServerBase owner)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(owner As OpcServerBase)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `owner` | [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) | The [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) the list belongs to. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `owner` is a null reference (Nothing in Visual Basic). |

**Remarks**

The entries created by the list evaluate operations and endpoints using the mode [Whitelist](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/#whitelist).

## Properties

### TokenType

<span class="api-meta">protected · override · since v2.42</span>

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

<div class="api-signature" data-lang="csharp">

```csharp
protected override OpcAccessControlTokenType TokenType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overrides ReadOnly Property TokenType As OpcAccessControlTokenType
```

</div>

**Property value**

[OpcAccessControlTokenType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontroltokentype/)

Always [UserName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontroltokentype/#username).

**Overrides**

[TokenType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#tokentype)

## Methods

### AddEntry

<span class="api-meta">9 overloads</span>

| Overload | Description |
|---|---|
| [AddEntry(string, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#addentry-system-string-system-string) | Adds an entry for a user with the `userName` and `password` specified. |
| [AddEntry(string, byte\[\])](#addentry-system-string-system-byte-array) | Adds an entry for a user with the `userName` and `password` specified. |
| [AddEntry(string, string, OpcAccessControlMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#addentry-system-string-system-string-opc-uafx-server-opcaccesscontrolmode) | Adds an entry for a user with the `userName` and `password` specified using the `operationAccessMode` specified. |
| [AddEntry(string, byte\[\], OpcAccessControlMode)](#addentry-system-string-system-byte-array-opc-uafx-server-opcaccesscontrolmode) | Adds an entry for a user with the `userName` and `password` specified using the `operationAccessMode` specified. |
| [AddEntry(string, string, OpcAccessControlMode, OpcAccessControlMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#addentry-system-string-system-string-opc-uafx-server-opcaccesscontrolmode-opc-uafx-server-opcaccesscontrolmode) | Adds an entry for a user with the `userName` and `password` specified using the `operationAccessMode` and `endpointAccessMode` specified. |
| [AddEntry(string, byte\[\], OpcAccessControlMode, OpcAccessControlMode)](#addentry-system-string-system-byte-array-opc-uafx-server-opcaccesscontrolmode-opc-uafx-server-opcaccesscontrolmode) | Adds an entry for a user with the `userName` and `password` specified using the `operationAccessMode` and `endpointAccessMode` specified. |
| [AddEntry(OpcServerIdentity)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#addentry-opc-uafx-server-opcserveridentity)<span class="api-meta">since v2.7</span> | Adds an entry for the `identity` specified. |
| [AddEntry(OpcServerIdentity, OpcAccessControlMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#addentry-opc-uafx-server-opcserveridentity-opc-uafx-server-opcaccesscontrolmode)<span class="api-meta">since v2.7</span> | Adds an entry for the `identity` specified using the `operationAccessMode` specified. |
| [AddEntry(OpcServerIdentity, OpcAccessControlMode, OpcAccessControlMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#addentry-opc-uafx-server-opcserveridentity-opc-uafx-server-opcaccesscontrolmode-opc-uafx-server-opcaccesscontrolmode)<span class="api-meta">since v2.7</span> | Adds 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.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(string userName, string password)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddEntry(
    userName As String,
    password As String) As OpcAccessControlEntry
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `userName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the user. |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password of the user. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The new [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the user.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `userName` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `userName` or `password` is a null reference (Nothing in Visual Basic). |

**Remarks**

The entry uses the [OperationAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#operationaccessmode) and the [EndpointAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#endpointaccessmode) of the list. Each call adds a new entry, also for a user name which is already used by another entry; [Authenticate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#authenticate) uses the first matching entry.

#### AddEntry(string, byte\[\])

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

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(string userName, byte[] password)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddEntry(
    userName As String,
    password As Byte()) As OpcAccessControlEntry
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `userName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the user. |
| `password` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The bytes of the password of the user, which need to equal the result of [TransformPassword](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/members#transformpassword) for the password a client provides; by default these are the bytes of the password encoded using UTF-16 (little endian). |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The new [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the user.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `userName` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `userName` or `password` is a null reference (Nothing in Visual Basic). |

**Remarks**

The entry uses the [OperationAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#operationaccessmode) and the [EndpointAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#endpointaccessmode) of the list. Each call adds a new entry, also for a user name which is already used by another entry; [Authenticate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#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.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    string password,
    OpcAccessControlMode operationAccessMode)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddEntry(
    userName As String,
    password As String,
    operationAccessMode As OpcAccessControlMode) As OpcAccessControlEntry
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `userName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the user. |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password of the user. |
| `operationAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The new [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the user.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `userName` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `userName` or `password` is a null reference (Nothing in Visual Basic). |

**Remarks**

The entry uses the [EndpointAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#endpointaccessmode) of the list. Each call adds a new entry, also for a user name which is already used by another entry; [Authenticate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#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.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    byte[] password,
    OpcAccessControlMode operationAccessMode)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddEntry(
    userName As String,
    password As Byte(),
    operationAccessMode As OpcAccessControlMode) As OpcAccessControlEntry
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `userName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the user. |
| `password` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The bytes of the password of the user, which need to equal the result of [TransformPassword](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/members#transformpassword) for the password a client provides; by default these are the bytes of the password encoded using UTF-16 (little endian). |
| `operationAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The new [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the user.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `userName` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `userName` or `password` is a null reference (Nothing in Visual Basic). |

**Remarks**

The entry uses the [EndpointAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#endpointaccessmode) of the list. Each call adds a new entry, also for a user name which is already used by another entry; [Authenticate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#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.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    string password,
    OpcAccessControlMode operationAccessMode,
    OpcAccessControlMode endpointAccessMode)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddEntry(
    userName As String,
    password As String,
    operationAccessMode As OpcAccessControlMode,
    endpointAccessMode As OpcAccessControlMode) As OpcAccessControlEntry
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `userName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the user. |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password of the user. |
| `operationAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly. |
| `endpointAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how the entry evaluates an endpoint which has neither been enabled nor disabled explicitly. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The new [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the user.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `userName` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#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.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(
    string userName,
    byte[] password,
    OpcAccessControlMode operationAccessMode,
    OpcAccessControlMode endpointAccessMode)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddEntry(
    userName As String,
    password As Byte(),
    operationAccessMode As OpcAccessControlMode,
    endpointAccessMode As OpcAccessControlMode) As OpcAccessControlEntry
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `userName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the user. |
| `password` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The bytes of the password of the user, which need to equal the result of [TransformPassword](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/members#transformpassword) for the password a client provides; by default these are the bytes of the password encoded using UTF-16 (little endian). |
| `operationAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how the entry evaluates an operation which has neither been allowed nor denied explicitly. |
| `endpointAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how the entry evaluates an endpoint which has neither been enabled nor disabled explicitly. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The new [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the user.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `userName` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcusernameacl/members#authenticate) uses the first matching entry.

#### AddEntry(OpcServerIdentity)

<span class="api-meta">since v2.7</span>

Adds an entry for the `identity` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(OpcServerIdentity identity)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddEntry(identity As OpcServerIdentity) As OpcAccessControlEntry
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `identity` | [OpcServerIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/) | The [OpcServerIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/) of the user. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the `identity`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `identity` is a null reference (Nothing in Visual Basic). |

**Remarks**

A new entry uses the [OperationAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#operationaccessmode) and the [EndpointAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#endpointaccessmode) of the list. If the list already contains an entry for the `identity`, that entry is returned unchanged.

#### AddEntry(OpcServerIdentity, OpcAccessControlMode)

<span class="api-meta">since v2.7</span>

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

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(
    OpcServerIdentity identity,
    OpcAccessControlMode operationAccessMode)
```

</div>

<div class="api-signature" data-lang="vbnet">

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `identity` | [OpcServerIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/) | The [OpcServerIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/) of the user. |
| `operationAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how a new entry evaluates an operation which has neither been allowed nor denied explicitly. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the `identity`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `identity` is a null reference (Nothing in Visual Basic). |

**Remarks**

A new entry uses the [EndpointAccessMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#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)

<span class="api-meta">since v2.7</span>

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

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlEntry AddEntry(
    OpcServerIdentity identity,
    OpcAccessControlMode operationAccessMode,
    OpcAccessControlMode endpointAccessMode)
```

</div>

<div class="api-signature" data-lang="vbnet">

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `identity` | [OpcServerIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/) | The [OpcServerIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/) of the user. |
| `operationAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how a new entry evaluates an operation which has neither been allowed nor denied explicitly. |
| `endpointAccessMode` | [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) | One of the members defined by the [OpcAccessControlMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolmode/) enumeration which specifies how a new entry evaluates an endpoint which has neither been enabled nor disabled explicitly. |

**Returns**

[OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/)

The [OpcAccessControlEntry](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolentry/) of the `identity`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `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

<span class="api-meta">override · since v2.42</span>

Authenticates the `identityToken` specified if it is a user name identity token which matches the [OpcServerIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/) of an entry.

<div class="api-signature" data-lang="csharp">

```csharp
public override OpcPrincipal Authenticate(OpcIdentityToken identityToken)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Overrides Function Authenticate(
    identityToken As OpcIdentityToken) As OpcPrincipal
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `identityToken` | [OpcIdentityToken](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcidentitytoken/) | The [OpcIdentityToken](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcidentitytoken/) to authenticate. |

**Returns**

[OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/)

The [OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/) of the first entry whose identity matches the user name and password of the `identityToken` (see [Matches](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserveridentity/members#matches)); otherwise a null reference (Nothing in Visual Basic).

**Exceptions**

| Exception | Condition |
|---|---|
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The 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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badidentitytokenrejected). |

**Overrides**

[Authenticate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrollist/members#authenticate)

**Remarks**

An authenticated principal is assigned to the role [AuthenticatedUser](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserversecurityroles/members#authenticateduser).
