도와주세요! 가장 된 사용자의 자격 증명을 사용하여 원격 시스템을 요청하려면 asp 응용 프로그램이 필요합니다. 그러나 항상 401 Unauthorized 오류가 발생합니다. 여기에서 모든 구성을 만들었습니다. https://support.microsoft.com/en-us/help/810572/how-to-configure-an-asp-net-application-for-a-delegation-scenario Kerberos가 구성되어 있고 내 앱과 테스트 원격 앱에서 작동합니다 (피어 러의 kerberos 티켓 참조). 위임, 지원 및 모든 것이 구성됩니다. HTTP 요청이 AppPool을 계정에 의해 이루어집니다 사실kerberos 위임 시나리오의 ASP 이중 홉 요청
HttpClientHandler handler = new HttpClientHandler()
{
UseDefaultCredentials = true,
PreAuthenticate = true
};
using (HttpClient client = new HttpClient(handler))
{
client.DefaultRequestHeaders.Accept.Clear();
var method = new HttpMethod("GET");
var request = new HttpRequestMessage(method, "http://testdelegationapp.avp.ru/");
var response = client.SendAsync(request).Result;
}
가 (원격 응용 프로그램 IIS에서 AppPool을 계정에 대한 액세스를 제한 할 때 401 오류)
:내 코드 usnig System.Net.Http.httpclient 그게 전부 여기
: How to get HttpClient to pass credentials along with the request? 다른 스레드에 보안 토큰을 HttpClient를 기울인다을 통과하고 더 나은 웹 클라이언트를 사용하여 System.Net.WebClient
코드의 동기 방법을 사용하여 주장한다 :
var wi = (WindowsIdentity)HttpContext.User.Identity;
var wic = wi.Impersonate();
try
{
string URI = "http://testdelegationapp.avp.ru/";
using (WebClient wc = new WebClient())
{
wc.UseDefaultCredentials = true;
string response = wc.DownloadString(URI);
}
}
finally
{
wic.Undo();
}
결과가 더 나쁘고 같은 401 오류가 있지만 피들러에서 나는 원격 클라이언트에 도착하기 위해 NTLM 티켓을 사용하는 웹 클라이언트를 볼 수 있습니다!
흐름 토큰을 구성하면 여기에서 스레드가 throw됩니다. Unable to authenticate to ASP.NET Web Api service with HttpClient 도 도움이되지 않습니다. SecurityContext.IsWindowsIdentityFlowSuppressed()가 false입니다.
WindowsIdentity.GetCurrent() Name과 Thread.CurrentPrincipal.Identity.Name은 가장해야하는 것처럼 가장 된 사용자를 표시합니다.
이 시나리오에서 사용 된 클라이언트 OS는 무엇입니까? –
@ T-Heron Windows 10 – Gunman7840