I have created an ASP.Net core (net 8) web application using visual studio 2022.
I have set up windows authentication and authorisation to check if users exist in an AD group and log them in without having to submit credentials.
When deployed to the web server it works as expected however when I run the application locally in Visual Studio it prompts me to enter my Windows account details.
Does anyone know why this might be?
Thanks
Well, its hard to infer how did you configured your windows authentication, as you haven't shared with us and that's really important to check.
However, even if you set in
AD groupbut if within your projectlaunchSettings.jsondoesn't allowed"windowsAuthentication": trueyou might encounter that issue. So please double check that.Within your
launchSettings.json, you should have following configuration:Beside that, you might need to check your NegotiateDefaults.AuthenticationScheme configuration because this is also prerequisite for windows authentication.
Note: Please make sure you have enabled
windowsAuthenticationto true. In addition, please refer to this official document.