Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

HttpRequest::LogonUserIdentity Property

Gets the WindowsIdentity type for the current user.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

public:
property WindowsIdentity^ LogonUserIdentity {
	WindowsIdentity^ get ();
}

Property Value

Type: System.Security.Principal::WindowsIdentity
A WindowsIdentity object for the current Microsoft Internet Information Services (IIS) authentication settings.

ExceptionCondition
InvalidOperationException

The Web application is running in IIS 7 integrated mode and the PostAuthenticateRequest event has not yet been raised.

The LogonUserIdentity property exposes the properties and methods of the WindowsIdentity object for the currently connected user to Microsoft Internet Information Services (IIS). The instance of the WindowsIdentity class that is exposed by LogonUserIdentity tracks the IIS request token and provides easy access to this token for the current HTTP request being processed inside of ASP.NET. An instance of the WindowsIdentity class is automatically created so it does not need to be constructed to in order to gain access to its methods and properties.

The following code example shows how to retrieve the LogonUserIdentity property for the current user and write out the values of each item in a text file. Place this code on the ASP.NET page referenced by the form's ACTION attribute.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft