0

I have an ASP.NET Core Web API. When I run it in Visual Studio with IIS express, Windows authentication works fine.

However, when I deploy the API to IIS, it fails to use Windows authentication. I tried enabling Windows authentication, ASP.NET impersonation and disabled anonymous.

I've also changed the pool to various such as system, network etc. In addition, I changed the API from a console app to a library. Still to no avail.

This API used to work fine on .NET 6 and Windows 7. But since moving to Windows 10 and .NET 8, I can't get Windows authentication to work. Everything is on a single dev machine.

Would very much appreciate some pointers.

1
  • 1
    You cannot ask people to guess what's up, so instead you need to reveal "it fails" in which way. Good questions usually include important information like relevant XML fragments from IIS configuration, as well as key initialization code from their ASP.NET Core code base. Commented Jun 20, 2024 at 21:44

1 Answer 1

0

I am having exactly the same issue, I have my own AuthenticationStateProvider and the Windows user context is lost when running under IIS. Without my AuthenticationStateProvider injected the windows user is captured correctly. I removed all my code and its mere existence of a custom provider that causes this. Looks like a bug to me.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.