# OpcClassicIdentity Members

> Reference: Represents the identity of a user used to authenticate at the host of an OPC Classic server using DCOM.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcClassicIdentity</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.classic">Opc.UaFx.Classic</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 [OpcIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcidentity/members).

## Constructors

### OpcClassicIdentity

Initializes a new instance of the [OpcClassicIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicidentity/) class using the specified `userName` and `password`.

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

```csharp
public OpcClassicIdentity(string userName, string password)
```

</div>

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

```vbnet
Public Sub New(userName As String, password As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `userName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the user, optionally preceded by the domain and a backslash (e.g. "domain\\user"). |
| `password` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The password of the user. |

## Properties

### DisplayName

<span class="api-meta">override</span>

Gets the name of the identity to display.

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

```csharp
public override string DisplayName { get; }
```

</div>

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

```vbnet
Public Overrides ReadOnly Property DisplayName As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The name of the user, preceded by the domain and a backslash if a domain has been specified.

**Overrides**

[DisplayName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcidentity/members#displayname)

## Methods

### Impersonate

<span class="api-meta">override</span>

Impersonates the identity; not supported by a DCOM identity.

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

```csharp
public override OpcImpersonationContext Impersonate()
```

</div>

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

```vbnet
Public Overrides Function Impersonate() As OpcImpersonationContext
```

</div>

**Returns**

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

The method does not return.

**Exceptions**

| Exception | Condition |
|---|---|
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The identity does not support impersonation. |

**Overrides**

[Impersonate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcidentity/members#impersonate)

### ToString

<span class="api-meta">override</span>

Returns a string which represents the identity.

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

```csharp
public override string ToString()
```

</div>

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

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The [DisplayName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.classic.opcclassicidentity/members#displayname) in the format "DCOM-Identity=\[name\]".

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)
