Why is the logon_user variable blank when a user has windows 11 PC ?

Greg Booth 1,316 Reputation points
2024-07-08T11:04:40.38+00:00

We have a asp.net application. This uses windows authentication and reads the LOGON_USER variable to check if the current user is allowed access etc.

This all works from users using a windows 10 PC, but when the user has a windows 11 PC the LOGON_USER variable is blank and the user is prompted for credentials.

Is there anything we need to do to make the application work with Windows 11 ( as well as windows 10) ?

Is there a setting on the windows 11 PC ( i.e. the client) that controls behaviour ?

Thanks

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,481 questions
{count} votes

Accepted answer
  1. AgaveJoe 28,291 Reputation points
    2024-07-08T11:58:12.4733333+00:00

    We have a asp.net application. This uses windows authentication and reads the LOGON_USER variable to check if the current user is allowed access etc.

    The syntax to get the user name in an asp.net application is User.Identity.Name not SERVER_VARIABLE["LOGON_USER"].

    User.Identity.Name
    

    LOGON_USER is, The Windows account that the user is impersonating while connected to your Web server. Use REMOTE_USER, UNMAPPED_REMOTE_USER, or AUTH_USER to view the raw user name that is contained in the request header. The only time LOGON_USER holds a different value than these other variables is if you have an authentication filter installed.

    https://video2.skills-academy.com/en-us/previous-versions/iis/6.0-sdk/ms524602(v=vs.90)?redirectedfrom=MSDN


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.