HttpClientHandler.PreAuthenticate Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether the handler sends an Authorization header with the request.
public:
property bool PreAuthenticate { bool get(); void set(bool value); };
public bool PreAuthenticate { get; set; }
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public bool PreAuthenticate { get; set; }
member this.PreAuthenticate : bool with get, set
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
member this.PreAuthenticate : bool with get, set
Public Property PreAuthenticate As Boolean
Property Value
true
for the handler to send an HTTP Authorization header with requests after authentication has taken place; otherwise, false
. The default is false
.
- Attributes
Remarks
After a client request to a specific Uri is successfully authenticated, if the PreAuthenticate property is true
and credentials are supplied, HttpClientHandler matches against the credential list supplied in the Credentials property. The Authorization header is sent with each request to any Uri that matches the specific Uri up to the last forward slash.
If the client request to a specific Uri is not successfully authenticated, the request uses standard authentication procedures.
With the exception of the first request, the PreAuthenticate property indicates whether to send authentication information with subsequent requests to a Uri that matches the specific Uri up to the last forward slash without waiting to be challenged by the server.