Logon user name is empty

  • Thread starter Thread starter Alan T
  • Start date Start date
A

Alan T

ASP.NET 4.0

I tried to get the Windows Logon user by:

HttpContext.Current.User.Identity.Name.ToString();

But it return empty.



What I want to do is to get the full name of the logon user from Active
Directory.
 
Alan said:
ASP.NET 4.0

I tried to get the Windows Logon user by:

HttpContext.Current.User.Identity.Name.ToString();

But it return empty.

What I want to do is to get the full name of the logon user from Active
Directory.

Are you using authentication before allowing access to the application?
Or is this a website with anonymous user access, where you happen to be
logged into Windows on your machine while you are accessing the site,
thinking the application will know which Windows user you are?
 
ASP.NET 4.0
Are you using authentication before allowing access to the application? Or
is this a website with anonymous user access, where you happen to be
logged into Windows on your machine while you are accessing the site,
thinking the application will know which Windows user you are?

Hi,

At the moment, I am just testing by running within VWD 2010 Express
(locally) by pressing F5, and the Anonymous access disabled in IIS.

I can use these to find out my logon user:
string strName = Request.ServerVariables["LOGON_USER"];


Response.Write(strName);



It gives me, for example, that's correct:

mydomain\smithj
 
Are you using authentication before allowing access to the application?Or
is this a website with anonymous user access, where you happen to be
logged into Windows on your machine while you are accessing the site,
thinking the application will know which Windows user you are?

Hi,

At the moment, I am just testing by running within VWD 2010 Express
(locally) by pressing F5, and the Anonymous access disabled in IIS.

I can use these to find out my logon user:
string strName = Request.ServerVariables["LOGON_USER"];

Response.Write(strName);

It gives me, for example, that's correct:

mydomain\smithj

Alan,

Do you have the Integrated Windows Authentication checked for the site?
 
Back
Top