# OpcImpersonationContext Class

> Reference: Represents the context of an impersonation started by Impersonate, which undoes the impersonation.

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

<dl class="api-definition">
<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>Members</dt>
<dd><a href="./members">OpcImpersonationContext Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Represents the context of an impersonation started by [Impersonate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcidentity/members#impersonate), which undoes the impersonation.

## Syntax

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

```csharp
public abstract class OpcImpersonationContext
```

</div>

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

```vbnet
Public MustInherit Class OpcImpersonationContext
```

</div>

## Inheritance

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

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></li>
</ul>

## Derived types

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

## Constructors

| Name | Description |
|---|---|
| [OpcImpersonationContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcimpersonationcontext/members#opcimpersonationcontext)<span class="api-meta">protected</span> | Initializes a new instance of the OpcImpersonationContext class. |

## Methods

| Name | Description |
|---|---|
| [Dispose](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcimpersonationcontext/members#dispose)<span class="api-meta">2 overloads</span> | Releases all resources used by the OpcImpersonationContext. |
| [Undo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcimpersonationcontext/members#undo)<span class="api-meta">abstract</span> | Undoes the impersonation. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
