Class UnauthorizedResult
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
HttpRequestMessageThe 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
ApiControllerThe controller from which to obtain the dependencies needed for execution.
Properties
Challenges
Gets the WWW-Authenticate challenges.
public IEnumerable<AuthenticationHeaderValue> Challenges { get; }
Property Value
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>.