The described procedure doesn't work
When I follow the procedure described under "Use the Windows Authentication app template for a new project", I end up with a message in the browser "This site can’t be reached". I did try to change code/configuration in various ways (Google-ing, stackoverflow, etc.) but I couldn't make the Windows authentication work with ASP:NET Core. Please take a look and correct the article so that we can have a basic frame for starting working with Windows authentication.
I'm using: Microsoft Visual Studio Enterprise 2017 (Version 15.9.9) Microsoft .NET Core SDK 2.2.104 (x64)
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 401ad9a0-9e51-80a2-5846-82e9790d7257
- Version Independent ID: fbc36c26-9992-1f4c-66d3-02f898ee7ec4
- Content: Configure Windows Authentication in ASP.NET Core
- Content Source: aspnetcore/security/authentication/windowsauth.md
- Product: aspnet-core
- GitHub Login: @scottaddie
- Microsoft Alias: riande
This was recently tested. cc @guardrex
Then it's likely that there are other important prerequisites/conditions not mentioned in the article, necessary for the example to work.
I'm still out-of-town at a conference (no laptop with me), but I'll be flying back on Saturday and will try to look on Sunday.
I couldn't get to this immediately. I'm still ⛏ digging myself out. I'll look asap ... hopefully within a day or two.
@Rick-Anderson As far as I can tell, putting 3.0 preview on here and trying to run IIS Express with the dev cert is what's breaking. The app will run directly on Kestrel at https://localhost:5001.
I'm going to upgrade the VS here when it releases, and I'll try again and see what happens.
I did note one strange thing while playing with this ...
The test app that I set up for this didn't consume launchSettings.json when I ran the app with dotnet run. We've documented it for a long time, and I remember it working. https://docs.microsoft.com/aspnet/core/fundamentals/environments#development
Just to confirm that unfortunately the described process does not work. After deploying the application under IIS the Windows User is not detected. Hope you are planning a quick fix. Environments: Microsoft Visual Studio Enterprise 2017 (Version 15.9.10) Microsoft .NET Core SDK 2.2.105 (x64) .Net Hosting 2.2.3
@aleph0mc Yes, I'm going to update VS when it releases on April 2 (next Tuesday).
I'll move the priority on this up and get to it quickly.
@guardrex Thanks!
I'm installing VS 2019 now to work this issue. Could take a while tho ... need to install a big Win10 update first and Disk Cleanup this drive. 😅
It's fighting me a little bit. The workaround in https://github.com/aspnet/AspNetCore/issues/8378 didn't work.
However, going through my shiny new VS 2019 IIS Express does result in a request for credentials, so it's working there.
I have a feeling that when I get my IIS back in a good state that it's going to work. Preview 4 will fix the problem with the hosting bundle installer. I may wait until Preview 4 to get my ANCM woes sorted.
When you say "Preview 4", do you refer to .net core 3?
@guardrex You mentioned VS2019 and that's fair enough, but what about VS2017? Thx.
Yes, Preview 4 for .NET Core 3. They will have the hosting bundle installer fixed for Preview 4, which should fix my broken IIS/ANCM state ... get the right ANCM in the right spot. I tried the workaround last night, but it ended in :boom:. I'll try the workaround again today with fresh eyes and :coffee: :coffee: :coffee:.
I was hoping that the VS2019 install would fix my broken IIS/ANCM state. Nope ... didn't do it. IIS Express in VS2019 works fine—the app runs correctly with a prompt for credentials. So IIS Express is consuming the launchSettings.json file setting for WinAuth and the auth middleware is functioning correctly in that case. IIS/ANCM should have the same result once I get it running.
I'll post back later today (Wednesday) with an update.
Ok ... my IIS is back. Will see what's what now.
Working here ...
@mcurko try again with a fresh app following our guidance in the IIS topic. The problem with your app is probably related to an IIS misconfiguration of some sort.
Troubleshooting is here :point_right: Troubleshoot ASP.NET Core on IIS.
Common errors over here :point_right: Common errors reference for Azure App Service and IIS with ASP.NET Core.
Don't close this issue tho even if you get it working. I DO need to make some updates to the topic, and this issue will auto-close when the PR merges.