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
)

Parameters

httpRequestMessage
Type: System.Net.Http.HttpRequestMessage

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

user
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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft