locked
How can I test with Windows Authentication while developing? RRS feed

  • Question

  • User262936834 posted

    Fairly new with ASP.NET Core and decided to use this to build an intranet site.

    Obviously will be taking advantage of Windows Authentication in an Active Directory domain but how do I test this while on my development machine? If I start without debugging, this starts a local IIS express server on my laptop so will not show myself logged in.

    The way I am testing at the moment is by publishing it to our IIS machine, and I literally have three seperate laptops set up with user accounts logged in to test different areas of the intranet based on their group memberships.

    This seems cumbersome and I lose the ability to step by step debug using my development machine

    I feel like I'm developing it incorrectly

    Monday, June 17, 2019 6:01 PM

All replies

  • User475983607 posted

    Gorsey

    If I start without debugging, this starts a local IIS express server on my laptop so will not show myself logged in.

    Did you enable Windows Authentication?  Keep in mind, Core is multi-platform and Windows Authentication is not plus Windows Authentication is a IIS/Windows feature.  The user credentials are passed along to the Core application.

    Take a look at the reference docs and make sure the app is configured correctly.

    https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-2.2&tabs=visual-studio

    If the issue is testing accounts then you'll need to log out and log in as a different users.

    Monday, June 17, 2019 6:18 PM