icflorescu / iisexpress-proxy

A simple local proxy for accessing IIS Express from remote machines.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please mention in the read-me that projects with integrated Windows authentication aren't supported

mklement0 opened this issue · comments

First things first: thanks for a great utility.

It seems that projects that use integrated Windows authentication aren't supported by iisexpress-proxy - I get a "401.2 Unauthorized" error complaining about "invalid authentication headers".

Not sure if supporting such projects is even an option or on your roadmap, but it would be helpful if you documented the limitation in README.md.

Thank you the kind words.

I have no idea on how to possibly implement this, nor any chance to test such a scenario at the moment, but if you have any idea, please feel free to make a PR.

Meanwhile, I'll just add a quick reference to this issue in the README.md.

This is now in the README.md.

I appreciate it, thanks.

As for testing: In VS2015, if you create an ASP.NET Web Application and choose MVC on the 2nd creation-dialog page, and then click Change Authentication and choose option Windows Authentication, you'll get a project that requires valid Windows credentials to access the site.

You're implicitly authenticated on the dev machine when running from Visual Studio, but on external access you should be prompted for credentials in a pop-up dialog box - this is where proxying currently throws the Unauthorized error instead.

Unfortunately, I don't know how or even if the problem can be solved.

Hi Ionut,
Thanks for this fantastic tool. I too stumbled upon it, being redirected from one of your posts on StackOverflow. My scenario is as follows: I am developing a Line-of-Business Windows Store 8.1 application that I side-load on a tablet. This app uses a RESTful Web API currently running under IIS Express on my development machine. The app running on the tablet was not able to see the Web API because IIS Express does not exposes it to the outside world. While I was researching this issue I found your tool. I installed it on my development server and poof, the Web API was visible outside, all of a sudden. I was able to test it using Fiddler running on the tablet. However, my app still got HTTP 401.1 for all my calls and it's most likely because it uses Windows Authentication. This LoB application is supposed to work in the client's Intranet, hence the integrated authentication I have to use. The interesting thing though is that your tool works when I test from Fiddler. Normally, I would see 3 messages posted, the first 2 returning HTTP Code 401 and the third returning the nice 200. However, if I call a method from the Web API in Fiddler, running on the tablet, while the Web API runs under IIS Express on a remote machine and I also use iisexpress-proxy, I only see two messages posted. The first one is returned with 401 and the second one is returned with the nice 200 - OK.
I have spent an awful lot of time on Stack Overflow and MSDN, thinking that there is something wrong with my client code. I just found this post now and it kind of ruined my excitement about using your wonderful tool. Now, it looks like the only way out is to deploy the Web API under a full-blown IIS even though we may still have to make additions to it.

I have the exactly same problem when I was using browser sync and I ended here thinking that this were to solve my problem until I read that this does not work with windows authentication. What a shame, I'm reading a tons of articles about this and I'm not getting closer to a solution.

In the end, this blog post by Scott Hanselman helped me solve the problem. It is not as elegant as Ionut's solution, but it works with Windows Authentication.