0

I am trying to develop an application that uses AD for determining user access. I have implemented the windows authentication and it works when I deploy the app to IIS, but I want to use it while development time for debugging purposes. I have already configured the launchsettings.json file to have below.

"iisSettings": {
    "windowsAuthentication": true,
    "anonymousAuthentication": false,
    "iisExpress": {
        "applicationUrl": "http://localhost:5001",
        "sslPort": 5002
    }
}

Why am I not able to get this working. Is there something else that I am missing?

2 Answers 2

1

You said IIS-Express - do you have Web.config ?

<system.webServer>
    […]
    <security>
      <authentication>
        <anonymousAuthentication enabled="false"/>
        <windowsAuthentication enabled="true"/>
      </authentication>
    </security>
  </system.webServer>
Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I do have a web.config file with the same settings and I made sure it is copied to the build folder.
0

Right-click on the project and in the debug settings, changed the launch options to IIS. After that I got an error saying dotnet.exe not found. That error lead me to Unable to start process dotnet.exe, which says in IIS, web.config files are useless for aspnetcore projects. I then deleted the web.config file and it worked. I was able to get the user details into the IHttpContextAccessor.

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.