Modified application for MVC 4, AUTH_USER is empty

I have a hybrid classic ASP + ASP.NET MVC 4 application running under Win Server 2k3 (IIS6), which we updated to use MVC 4.

The ASP application is connected to the .NET application through a virtual directory. They work in the same application pool (if that matters). This particular application is an administrative control panel and uses basic authentication:

enter image description here

Before updating the project, when accessing the URL for the virtual folder, the browser will display a login prompt where I enter my user name and password corresponding to the domain. The ASP code then retrieves the username through Request.ServerVariables("AUTH_HEADER") , compares it with the list of permissions at the application level stored in the database, and enables or disables the functions on the admin site based on this.

After updating the project, I still get a login prompt, but Request.ServerVariables("AUTH_USER") returns an empty string.

I added the old project to the new website, so I can run them in parallel on the same server. The old code continues to work. The new code refuses. The admin virtual directory in each version of the .NET application indicates the same physical location on the disk, and the authentication configuration for the folder in both .NET applications is identical.

Suggestions? Note that the MVC 4 application uses the .NET 4 platform, not .NET 4.5, which is not installed on the server.

Note that although the default domain field in the screenshot is empty, it is correctly configured. I extracted it from the image for obvious reasons.

+1
source share
1 answer

Request.ServerVariables ("AUTH_USER") can be obtained when you configure your application to use forms authentication rather than Windows authentication. If this is Windows authentication, you should use Request.ServerVariables ("LOGON_USER")

0
source

Source: https://habr.com/ru/post/1502585/