Table of Contents

Class UnauthorizedResult

Namespace
System.Web.Http.Results
Assembly
System.Web.Http.dll

Represents an action result that returns an Unauthorized response.

public class UnauthorizedResult : IHttpActionResult
Inheritance
UnauthorizedResult
Implements
Inherited Members

Constructors

UnauthorizedResult(IEnumerable<AuthenticationHeaderValue>, HttpRequestMessage)

Initializes a new instance of the StatusCodeResult class.

public UnauthorizedResult(IEnumerable<AuthenticationHeaderValue> challenges, HttpRequestMessage request)

Parameters

challenges IEnumerable<AuthenticationHeaderValue>

The WWW-Authenticate challenges.

request HttpRequestMessage

The request message which led to this result.

UnauthorizedResult(IEnumerable<AuthenticationHeaderValue>, ApiController)

Initializes a new instance of theStatusCodeResult class.

public UnauthorizedResult(IEnumerable<AuthenticationHeaderValue> challenges, ApiController controller)

Parameters

challenges IEnumerable<AuthenticationHeaderValue>

The WWW-Authenticate challenges.

controller ApiController

The controller from which to obtain the dependencies needed for execution.

Properties

Challenges

Gets the WWW-Authenticate challenges.

public IEnumerable<AuthenticationHeaderValue> Challenges { get; }

Property Value

IEnumerable<AuthenticationHeaderValue>

Returns IEnumerable<T>.

Request

Gets the request message which led to this result.

public HttpRequestMessage Request { get; }

Property Value

HttpRequestMessage

Returns HttpRequestMessage.

Methods

ExecuteAsync(CancellationToken)

public virtual Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

Returns Task<TResult>.