Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mklement0 opened this issue Mar 24, 2016 · 6 comments

Comments

@mklement0
Copy link

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.

@icflorescu
Copy link
Owner

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.

@icflorescu
Copy link
Owner

This is now in the README.md.

@mklement0
Copy link
Author

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.

@Mensana88
Copy link

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.

@byoigres
Copy link

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.

@Mensana88
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants