System.Web.Services.WebService.User Property

Gets the ASP.NET server System.Web.HttpContext.User object. Can be used to authenticate whether a user is authorized to execute the request.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public System.Security.Principal.IPrincipal User { get; }

Value

a System.Security.Principal.IPrincipal

Remarks

Both Internet Information Services (IIS) and the .NET Framework need to be configured for authentication in order for the WebService.User 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.

Example

 <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>].

Requirements

Namespace: System.Web.Services
Assembly: System.Web.Services (in System.Web.Services.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0