Logon user name is empty

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.
 
H

Harlan Messinger

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?
 
A

Alan T

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
 
H

Harv

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top