Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SetUserPrincipal Method
Collapse the table of content
Expand the table of content

HttpRequestMessageExtensionMethods.SetUserPrincipal Method

.NET Framework 4.6 and 4.5

Replaces the user principal associated with the specified HTTP request message.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public static void SetUserPrincipal(
	this HttpRequestMessage httpRequestMessage,
	IPrincipal user


Type: System.Net.Http.HttpRequestMessage

The HTTP request message from which to set the user principal.

Type: System.Security.Principal.IPrincipal

The user principal to set.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpRequestMessage. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework

Supported in: 4.6, 4.5
© 2015 Microsoft