WebRequest.UseDefaultCredentials Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

When overridden in a descendant class, gets or sets a Boolean value that controls whether default credentials are sent with requests.

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


Public Overridable Property UseDefaultCredentials As Boolean
public virtual bool UseDefaultCredentials { get; set; }

Property Value

Type: System..::.Boolean
true if the default credentials are used; otherwise false. For requests created using the ClientHttp stack, the default value is false.


Exception Condition

This property is not implemented.


Set this property to true when requests made by this WebRequest object should, if requested by the server, be authenticated using the credentials of the currently logged on user. For client applications, this is the desired behavior in most scenarios. For applications that wish to control the authentication user experience, instead of using this property you would typically set the Credentials property to the credentials of the client on whose behalf the request is made.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0


Windows Phone

See Also


WebRequest Class

System.Net Namespace