IIdentity Interface

Overview

Represents the identity of a code entity, such as a user or a service.

The IIdentity interface is the base interface for all identity classes. It represents the identity of a code entity, such as a user or a service. It provides a single property, Name, which returns the name of the identity.

In the .NET Framework, identity is typically represented by an object that implements the IIdentity interface. This object can be associated with a thread or a principal object to define the security context for code execution.

Syntax

public interface IIdentity
{
    // Properties
    string Name { get; }
    string AuthenticationType { get; }
    bool IsAuthenticated { get; }
}

Members

Member Description
Name Gets the name of the current principal.
AuthenticationType Gets the type of authentication that was used to authenticate the principal.
IsAuthenticated Gets a value indicating whether the principal has been authenticated.

Requirements

Assembly DLL
mscorlib mscorlib.dll

Note

This documentation is for the .NET Framework. For .NET Core and .NET 5+, the namespace and classes might differ.