# OpcClientSecurity Members

> Reference: Defines the different security configurations supported by the OpcClient.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcClientSecurity</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

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

## Properties

### AuthenticationLevel

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

Gets or sets the level of DCOM authentication to use when connecting to an OPC Classic server and creating DCOM objects.

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

```csharp
public OpcClassicAuthenticationLevel? AuthenticationLevel { get; set; }
```

</div>

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

```vbnet
Public Property AuthenticationLevel As OpcClassicAuthenticationLevel?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcClassicAuthenticationLevel](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthenticationlevel/)&gt;

One of the members defined by the [OpcClassicAuthenticationLevel](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthenticationlevel/) enumeration or a null reference (Nothing in Visual Basic). If a null reference (Nothing in Visual Basic) is used no application wide DCOM security is initialized; otherwise the DCOM security is initialized with the value specified. Any subsequent creation of DCOM objects will additionally use the authentication level specified. If no authentication level is specified the [PacketIntegrity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthenticationlevel/#packetintegrity) is used for DCOM object creation.

### AuthenticationService

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

Gets or sets the DCOM authentication service to use to identify the security package to use when connecting to an OPC Classic server and creating DCOM objects.

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

```csharp
public OpcClassicAuthenticationService? AuthenticationService { get; set; }
```

</div>

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

```vbnet
Public Property AuthenticationService As OpcClassicAuthenticationService?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcClassicAuthenticationService](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthenticationservice/)&gt;

One of the members defined by the [OpcClassicAuthenticationService](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthenticationservice/) enumeration or a null reference (Nothing in Visual Basic). If a null reference (Nothing in Visual Basic) is used no application wide DCOM security is initialized; otherwise the DCOM security is initialized with the value specified. Any subsequent creation of DCOM objects will additionally use the authentication service specified. If no authentication service is specified the [WinNt](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthenticationservice/#winnt) is used for DCOM object creation.

### AuthorizationService

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

Gets or sets the DCOM authorization service to use to define what the server authorizes when connecting to an OPC Classic server and creating DCOM objects.

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

```csharp
public OpcClassicAuthorizationService? AuthorizationService { get; set; }
```

</div>

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

```vbnet
Public Property AuthorizationService As OpcClassicAuthorizationService?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcClassicAuthorizationService](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthorizationservice/)&gt;

One of the members defined by the [OpcClassicAuthorizationService](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthorizationservice/) enumeration or a null reference (Nothing in Visual Basic). If a null reference (Nothing in Visual Basic) is used no application wide DCOM security is initialized; otherwise the DCOM security is initialized with the value specified. Any subsequent creation of DCOM objects will additionally use the authorization serivce specified. If no authorization service is specified the [None](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicauthorizationservice/#none) is used for DCOm object creation.

### AutoUpgradeEndpointPolicy

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

Gets or sets a value indicating whether the client have to select an endpoint which uses at least the policy configured by the [EndpointPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#endpointpolicy) and in case there such an endpoint is missing the endpoint with the next best policy is to be used instead.

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

```csharp
public bool AutoUpgradeEndpointPolicy { get; set; }
```

</div>

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

```vbnet
Public Property AutoUpgradeEndpointPolicy As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the client shall automatically upgrade the [EndpointPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#endpointpolicy) configured to the next best policy in case non of the offered endpoints supports exactly the policy expected; otherwise the value false.

### EndpointPolicy

Gets or sets the policy configuration of the endpoint of the server to connect to.

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

```csharp
public OpcSecurityPolicy EndpointPolicy { get; set; }
```

</div>

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

```vbnet
Public Property EndpointPolicy As OpcSecurityPolicy
```

</div>

**Property value**

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

An instance of the [OpcSecurityPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/) class which defines the different policy characteristics an endpoint have to use to that the client will connect. Only in case there is an explicit [OpcSecurityPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/) instance defined the client will only connect to such an endpoint. In case there this property is set to a null reference (Nothing in Visual Basic) the automatic endpoint selection will be used. This means that the endpoint will be selected using the properties [UseOnlySecureEndpoints](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#useonlysecureendpoints) and [UseHighLevelEndpoint](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#usehighlevelendpoint). In case there this property is set to a concrete endpoint policy configuration the client will select the first endpoint which exactly matches the endpoint policy configuration defined by this property. The default value of this property is a null reference (Nothing in Visual Basic).

### ImpersonationLevel

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

Gets or sets the level of DCOM impersonation to use when connecting to an OPC Classic server and creating DCOM objects.

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

```csharp
public OpcClassicImpersonationLevel? ImpersonationLevel { get; set; }
```

</div>

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

```vbnet
Public Property ImpersonationLevel As OpcClassicImpersonationLevel?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcClassicImpersonationLevel](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicimpersonationlevel/)&gt;

One of the members defined by the [OpcClassicImpersonationLevel](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicimpersonationlevel/) enumeration or a null reference (Nothing in Visual Basic). If a null reference (Nothing in Visual Basic) is used no application wide DCOM security is initialized; otherwise the DCOM security is initialized with the value specified. Any subsequent creation of DCOM objects will additionally use the impersonation level specified. If no impersonation level is specified the [Impersonate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicimpersonationlevel/#impersonate) is used for DCOM object creation.

### ProxyCapabilities

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

Gets or sets the DCOM proxy capabilities to use when connecting to an OPC Classic server and creating DCOM objects.

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

```csharp
public OpcClassicProxyCapabilities? ProxyCapabilities { get; set; }
```

</div>

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

```vbnet
Public Property ProxyCapabilities As OpcClassicProxyCapabilities?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcClassicProxyCapabilities](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicproxycapabilities/)&gt;

One or more members defined by the [OpcClassicProxyCapabilities](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicproxycapabilities/) enumeration or a null reference (Nothing in Visual Basic). If a null reference (Nothing in Visual Basic) is used no application wide DCOM security is initialized; otherwise the DCOM security is initialized with the value specified. Any subsequent creation of DCOM objects will additionally use the proxy capabilities specified. If no proxy capabilities are specified the [None](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicproxycapabilities/#none) is used for DCOM object creation.

### UseHighLevelEndpoint

Gets or sets a value indicating whether the client have to select an endpoint which uses the highest policy level available ([Level](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#level)).

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

```csharp
public bool UseHighLevelEndpoint { get; set; }
```

</div>

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

```vbnet
Public Property UseHighLevelEndpoint As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the client have to automatically select the endpoint its [Policy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointdescription/members#policy) defines the highest policy level (see [Level](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritypolicy/members#level)) of all endpoints provided; otherwise the value false (the default value is false).

**Remarks**

The value of this property will only take affect in case there is not an explicit endpoint policy defined by [EndpointPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#endpointpolicy). Only in case there the [EndpointPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#endpointpolicy) property defines no explicit endpoint policy - the property value is a null reference (Nothing in Visual Basic) - then the value of this property is respected.

In case there the value of this property is set to true (= OPC UA default behavior), the policy level of the servers endpoints decides about the endpoint selection. This means that the client will select the endpoint with the highest policy level.

### UseOnlySecureEndpoints

Gets or sets a value indicating whether the client have to select an endpoint which uses a different [OpcSecurityMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritymode/) than [None](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritymode/#none).

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

```csharp
public bool UseOnlySecureEndpoints { get; set; }
```

</div>

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

```vbnet
Public Property UseOnlySecureEndpoints As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the client have to respect endpoints which using no security (= security mode is equals [None](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsecuritymode/#none)); otherwise the value false (the default value is false).

**Remarks**

The value of this property will only take affect in case there is not an explicit endpoint policy defined by [EndpointPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#endpointpolicy). Only in case there the [EndpointPolicy](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientsecurity/members#endpointpolicy) property defines no explicit endpoint policy - the property value is a null reference (Nothing in Visual Basic) - then the value of this property is respected.

In case there the value of this property is set to true, there is no guarantee that the client will select an endpoint with no security. This property just indicates whether endpoints (independent from their policy level) with no security have to be also taken into consideration.

### UserIdentity

Gets or sets the identity to use to authenticate the client sessions against the server.

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

```csharp
public OpcUserIdentity UserIdentity { get; set; }
```

</div>

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

```vbnet
Public Property UserIdentity As OpcUserIdentity
```

</div>

**Property value**

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

An instance of one of the [OpcUserIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcuseridentity/) derivatives defining the credentials to use to authenticate the client sessions against the server or a null reference (Nothing in Visual Basic) in case there an anonymous identity is to be used by the server to authenticate the client sessions.

**Remarks**

Only in case there the server supports an user token policy for anonymous user access (the 'Opc.UaFx.Server.OpcAnonymousAcl' is to be enabled) this property can be left with a null reference (Nothing in Visual Basic); otherwise there is a concrete instance of one of the [OpcUserIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcuseridentity/) derivatives required.

The following derivatives can be used to define an user identity:

1. [OpcClientIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientidentity/) Defines an identity using an user name and a password as the credentials to use to authenticate against the server. This will only work in case there the server supports an username user token policy for user name for user name and password authentication (the 'Opc.UaFx.Server.OpcUserNameAcl' is to be enabled).
2. [OpcCertificateIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccertificateidentity/) Defines an identity using certificate data as the credentials to use to authenticate against the server. This will only work in case there the server supports an certificate user token policy for certificate based authentication. (the 'Opc.UaFx.Server.OpcCertificateAcl' is to be enabled).

### VerifyServersCertificateDomains

Gets or sets a value indicating whether the client have to verify the domain names referenced in the servers certificate.

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

```csharp
public bool VerifyServersCertificateDomains { get; set; }
```

</div>

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

```vbnet
Public Property VerifyServersCertificateDomains As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the servers certificate domain names have to be verified on their existence; otherwise the value false (the default value is false).

**Remarks**

In case there this option is set to true, the client will investigate the domain names of the servers certificate. In case there is one of the domain names unknown and can't be resolved the client will refuse to establish a connection to the server.
