WebRequestInformation.Principal Property

Definition

Gets the instance of the managed-code principal associated with the Web request.

C#
public System.Security.Principal.IPrincipal Principal { get; }

Property Value

The IPrincipal instance that is associated with the request event.

Examples

The following code example shows how to use the principal associated with the Web request.

C#
// Get the request principal.
public string GetRequestPrincipal()
{
    // Get the request principal.
    return (string.Format(
        "Request principal name: {0}",
        RequestInformation.Principal.Identity.Name));
}

Remarks

The principal refers to the authenticated entity that issued the Web request.

Applies to

Tuote Versiot
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1