Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Logon user name is empty

Reply
Thread Tools

Logon user name is empty

 
 
Alan T
Guest
Posts: n/a
 
      07-14-2010
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.


 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      07-14-2010
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?
 
Reply With Quote
 
 
 
 
Alan T
Guest
Posts: n/a
 
      07-14-2010
>> 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



 
Reply With Quote
 
Harv
Guest
Posts: n/a
 
      07-21-2010
On Jul 14, 5:08*pm, "Alan T" <(E-Mail Removed)> 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Events: Logon vs Account Logon Jeroen Wijnands MCSA 0 03-06-2006 03:45 PM
Question Help: Logon vs Account Logon, Local Logon vs Authentication CJH Microsoft Certification 0 01-04-2006 04:03 PM
What is best practice: Combining anonymous logon with windows logon? Kjell Kristiansson ASP .Net Security 0 11-30-2005 12:53 PM
Problem: XP Home Logon Names Vanish - Cant Logon Graham Computer Support 0 01-24-2004 11:34 AM
Retrieve logon user name from ADSI venkat ASP .Net 0 11-06-2003 06:41 AM



Advertisments