Gets the ASP.NET server User object. Can be used to authenticate whether a user is authorized to execute the request.
Assembly: System.Web.Services (in System.Web.Services.dll)
Both Internet Information Services (IIS) and the .NET Framework need to be configured for authentication in order for the property to be meaningful. Authentication is the process of accepting credentials from a user and validating those credentials against some authority. If the credentials are valid, you have an authenticated identity. Authentication in the .NET Framework is configured by placing entries in the web.config file.
The following example demonstrates the entries you place in the web.config file to enable Windows authentication.
<security> <authentication mode="Windows"> <!-- Mode Options are Windows, Cookie, Passport and None or Empty String --> </authentication> </security>
For more information on setting up security for an XML Web service see [<topic://cpconSecuringASPNETWebServices>].
The example below looks up the authenticated user name and returns that name.
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.