mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-10 15:05:19 +00:00
31437b9492
* initial commit * removed old files * initial commit
33 lines
959 B
C#
33 lines
959 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Web.Http;
|
|
|
|
namespace securecall.Results
|
|
{
|
|
public class ChallengeResult : IHttpActionResult
|
|
{
|
|
public ChallengeResult(string loginProvider, ApiController controller)
|
|
{
|
|
LoginProvider = loginProvider;
|
|
Request = controller.Request;
|
|
}
|
|
|
|
public string LoginProvider { get; set; }
|
|
public HttpRequestMessage Request { get; set; }
|
|
|
|
public Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
|
|
{
|
|
Request.GetOwinContext().Authentication.Challenge(LoginProvider);
|
|
|
|
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
|
response.RequestMessage = Request;
|
|
return Task.FromResult(response);
|
|
}
|
|
}
|
|
}
|