Tag: Windows身份validation

我如何使用jQuery将Windows身份validation传递给webservice?

我正在使用jQuery来调用.Net Web服务,如下所示: var service_url = "https://example.com/myservice.asmx" $.ajax({ type: "GET", url: service_url, dataType: "xml", data: "ParamId=" + FormId.value, processData: false, error: function(XMLHttpRequest, textStatus, errorThrown) { ajaxError(XMLHttpRequest, textStatus, errorThrown); }, success: function(xml) { DoSomething(xml); } }); 现在我想在Windows身份validation中打包“ https://example.com/myservice.asmx ”。 我如何使用jQuery / JavaScript将凭证传递给服务? 理想情况下,我想使用当前用户的凭据,但如果需要,我可以为所有服务调用使用1个主凭证。

ASP.NET Windows身份validation注销

如何在ASP.NET中使用Windows身份validation(如此web.config)时注销? <authentication mode="Windows" /> 我已经尝试了以下失败。 它redirect,但不会注销用户。 void logoutButton_Click(object sender, EventArgs e) { HttpContext.Current.Session.Clear(); HttpContext.Current.Session.Abandon(); ViewState.Clear(); FormsAuthentication.SignOut(); Response.Redirect("/"); } 背景信息: 我必须使用Windows身份validation,因为我需要使用Active Directory来模拟身份以访问本地文件。 而且我不能模拟使用Forms身份validation,因为HttpContext.Current.User.Identity不会是WindowsIdentity 。 使用表单身份validation模拟