# OpcIdentity Members

> Reference: Represents the identity of a user, which is described by a token.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcIdentity</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</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>

## Constructors

### OpcIdentity

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

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

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

```csharp
protected OpcIdentity(object token)
```

</div>

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

```vbnet
Protected Sub New(token As Object)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `token` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The token which describes the identity. |

**Exceptions**

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

## Properties

### DisplayName

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

Gets the name of the identity to display.

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

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

</div>

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

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

</div>

**Property value**

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

The display name of the identity.

### Token

Gets the token which describes the identity.

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

```csharp
public object Token { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Token As Object
```

</div>

**Property value**

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

The token passed to the constructor.

## Methods

### Impersonate

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

Impersonates the user represented by the identity.

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

```csharp
public abstract OpcImpersonationContext Impersonate()
```

</div>

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

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

</div>

**Returns**

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

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