1

We have an ASP.NET application that uses Windows Authentication against Active Directory to authenticate its users. Even though its using windows auth, IIS prompts for the username/password because the site is being accessed through a url that is not the server name (not unexpected, as per support.microsoft.com/kb/258063). This is fine, but we have client programs that we have authored ourselves (automated UI testing suites, screen scrapers page/site health monitors, etc.) that cannot access the site because of the login prompt.

Since we have full access to the source code of these client programs, is there any way to programmatically pass the app's credentials to the login prompt in order to automate the login process?

Daniel Szabo
  • 7,181
  • 6
  • 48
  • 65
  • The url used should have nothing to do with authentication. Are you sure you don't mean an SSL connection? Pass through Windows Authentication only works with Internet Explorer, and since you don't explain what you mean by "applications" here.. It's hard to tell. We know nothing about how these applications are written, what technology they use, etc... – Erik Funkenbusch Feb 09 '14 at 20:21
  • Pass through authentication can work for with Firefox if you modify the about:config. – mason Feb 09 '14 at 20:35
  • Refer the following links: http://stackoverflow.com/questions/19316172/httpclient-windows-auth-pass-logged-in-user-of-consumer-to-service http://stackoverflow.com/questions/12212116/how-to-get-httpclient-to-pass-credentials-along-with-the-request?lq=1 – Gaurav Karwal Feb 09 '14 at 20:52
  • @ErikTheViking: In order for IE to automatically pass Windows creds, it must consider the target site to be part of the intranet (http://support.microsoft.com/kb/258063). The client applications I'm referring to are automated test apps, site scrapers, etc that must gain access to the site in order to do their thing. These are console apps, forms apps, etc written in C# .NET 4.0+. – Daniel Szabo Feb 10 '14 at 02:55

1 Answers1

0

Without knowing more about your client applications it is difficult to answer your question. In general, most platforms do allow you to pass credentials, so go look up how to do that in the architecture the client apps were built with.

mason
  • 31,774
  • 10
  • 77
  • 121
  • +1, if the client is built on .NET, pre-authentication can solve the problem, http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.preauthenticate(v=vs.110).aspx – Lex Li Feb 10 '14 at 03:08
  • Thanks for the input. I've researched but I can't find anything that directly answers my question in regards to the .NET framework (maybe I'm just not asking the _right_ question). I've updated my question with the info you referred to in your answer. Thanks for taking the time! – Daniel Szabo Feb 10 '14 at 03:10
  • Again, please read my answer. It depends on what the applications are written in and whether you have access to the source code, or what configuration options the applications have. Without us knowing the details of that, we can't help you much more than we already have. – mason Feb 10 '14 at 13:26