From: Alan T on
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.


From: Harlan Messinger on
Alan T wrote:
> 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?
From: Alan T on
>> 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?

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



From: Harv on
On Jul 14, 5:08 pm, "Alan T" <alan_NO_SPAM_pl...(a)yahoo.com.au> wrote:
> >> 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?
>
> 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?