Home > Software engineering >  Problems with windows credentials IIS 10.0
Problems with windows credentials IIS 10.0

Time:05-19

I have a .NET core 3.1 razor pages website. I'm using windows credentials (with Active directory) for authentication and I'm managing authorization using policies. Using IIS express (the one you use when developing is working ok. My username is displayed)

Now I'm using the IIS manager to host this site using my machine IP, for example 'xxx.xxx.xxx.xxx:portNumber'. This is loading if anonymous authentication is on, but if I include windows credentials it is failing. I followed the guide from here --> error image 1

And when I try to access the website, it is throwing Error HTTP 500.19 - Internal Server Error

Module: WindowsAuthenticationModule

Notification: AuthenticateRequest

source of config

  <anonymousAuthentication enabled="false" />
   **<windowsAuthentication enabled="true" />** --> *this line is in red*
  </authentication>

Here I changed a couple of lines in applicationhost.config file.

<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<section name="windowsAuthentication" overrideModeDefault="Allow" />

I changed both lines from Deny to Allow. Restart, but it doesn't work.

I've activated some windows features too like the following windows features

CodePudding user response:

I finally solved it. I referred to this post This configuration section cannot be used at this path - Windows 2016

I setted the following entries in the file located in C:\Windows\System32\inetsrv\config\applicationHost.config

<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<section name="windowsAuthentication" overrideModeDefault="Allow" />
<section name="ipSecurity" overrideModeDefault="Allow" />

I mistakenly edited the applicationHost.config located in IISExpress in my documents folder. That's why this wasn't working.

  • Related