HttpContext.Current.Request.LogonUserIdentity.Name returns more than one user RRS feed

  • Question

  • Using VS 2017,, framework 4.5, Windows 10, IIS V10.0.17763.1

    All authentication is set to WindowsAuthentication

    In our domain, I have 2 Active Directory accounts, my main account and one for testing. We are trying to upgrade our web apps to VS 2017. "HttpContext.Current.User.Identity.Name" was not working, but changing it to  "HttpContext.Current.Request.LogonUserIdentity.Name" finally gave me users, but now I get an array with both my user accounts in it like this: "A00001@MYDOM T00001@mydom". I can split it to get only the user I need, however, every other function (for example "HttpContext.Current.Request.LogonUserIdentity.Groups") fails because the user of 'LogonUserIdentity' is an array, not a single value, and I can't figure out how to make it only recognize the first user, A00001@MYDOM. I will also have to make it recognize the second user when testing.

    How I can get it to only recognize a specific user when a single user has multiple AD accounts?

    Wednesday, March 13, 2019 8:17 PM

All replies

  • Web based solutions can be discussed at thje ASP.NET forums.

    • Edited by DA924x Thursday, March 14, 2019 3:19 AM
    Thursday, March 14, 2019 3:19 AM