How can I pass windows authentication to webservice using jQuery?

I think nowadays you can just set the withCredentials property of the request object to true, e.g.: $.ajax({ type: “GET”, url: service_url, dataType: “xml”, data: “ParamId=” + FormId.value, processData: false, xhrFields: { withCredentials: true }, error: function(XMLHttpRequest, textStatus, errorThrown) { ajaxError(XMLHttpRequest, textStatus, errorThrown); }, success: function(xml) { DoSomething(xml); } }); That causes existing authentication headers/cookies … Read more

IIS7: Setup Integrated Windows Authentication like in IIS6

To enable the Windows Authentication on IIS7 on Windows 7 machine: Go to Control Panel Click Programs >> Programs and Features Select “Turn Windows Features on or off” from left side. Expand Internet Information Services >> World Wide Web Services >> Security Select Windows Authentication and click OK. Reset the IIS and Check in IIS … Read more

ASP.NET MVC – Authenticate users against Active Directory, but require username and password to be inputted

You can use the standard Internet application template with forms authentication and insert an ActiveDirectoryMembershipProvider into the web.config: <connectionStrings> <add name=”ADConnectionString” connectionString=”LDAP://YOUR_AD_CONN_STRING” /> </connectionStrings> <system.web> <authentication mode=”Forms”> <forms name=”.ADAuthCookie” loginUrl=”~/Account/LogOn” timeout=”15″ slidingExpiration=”false” protection=”All” /> </authentication> <membership defaultProvider=”MY_ADMembershipProvider”> <providers> <clear /> <add name=”MY_ADMembershipProvider” type=”System.Web.Security.ActiveDirectoryMembershipProvider” connectionStringName=”ADConnectionString” attributeMapUsername=”sAMAccountName” /> </providers> </membership> </system.web> In this way you get the … Read more

Windows authentication in asp.net 5

Mark’s answer is still valid in ASP.Net RC1. There are some additional steps to tie it all together (I don’t have enough reputation to comment on his solution): Install WebListener from NuGet Add the following usings to Startcup.cs: using Microsoft.AspNet.Http.Features; using Microsoft.Net.Http.Server; Add Mark’s code snippet in the Configure method before app.UseMvc: // If we’re … Read more

Impersonate using Forms Authentication

Impersonating a user using Forms Authentication can be done. The following code does work. The Visual Studio Magazine article referred to by Robert is an excellent resource. There are a some issues with the example code in the article, so I’ve included some working code below. Note: If you are using Visual Studio, make sure … Read more

Windows Integrated Authentication in node.js Client

2015 Update: There are now some modules that implement Windows-integrated authentication. node-sspi uses SSPI (the Windows security API) to handle the server side of things, but does not do client auth. There are several client implementations such as http-ntlm, but they are not truly integrated since they require the user password — they do not … Read more