Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Get the current logged in user name

Reply
Thread Tools

Get the current logged in user name

 
 
Imran Aziz
Guest
Posts: n/a
 
      08-02-2005
Hello All,
I am new to .net. I want to use windows authentication to authenticate
against the current logged in user on the client machine. I believe by using
windows authentication method, the IIS will send me details of the current
logged in user at the client machine if integrated windows authentication is
enabled at IIS. Can anyone please guide me how I can get the name of the
current logged in client that is making a request to my ASP.net application
?

I am trying to look into System.Web.Security class for this but have not
been able to find a piece of code or guidance of how to do it.

Imran.


 
Reply With Quote
 
 
 
 
Nicole Calinoiu
Guest
Posts: n/a
 
      08-02-2005
See http://msdn.microsoft.com/library/en...SecNetAP05.asp for
a list of the three properties that expose user identity information that
may be useful in your application, as well as descriptions of how various
IIS and ASP.NET authentication and identity configurations affect the
property values.



"Imran Aziz" <> wrote in message
news:...
> Hello All,
> I am new to .net. I want to use windows authentication to authenticate
> against the current logged in user on the client machine. I believe by
> using windows authentication method, the IIS will send me details of the
> current logged in user at the client machine if integrated windows
> authentication is enabled at IIS. Can anyone please guide me how I can get
> the name of the current logged in client that is making a request to my
> ASP.net application ?
>
> I am trying to look into System.Web.Security class for this but have not
> been able to find a piece of code or guidance of how to do it.
>
> Imran.
>



 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      08-02-2005
User.Identity.Name

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hello All,
> I am new to .net. I want to use windows authentication to
> authenticate
> against the current logged in user on the client machine. I believe by
> using
> windows authentication method, the IIS will send me details of the
> current logged in user at the client machine if integrated windows
> authentication is enabled at IIS. Can anyone please guide me how I can
> get the name of the current logged in client that is making a request
> to my ASP.net application ?
>
> I am trying to look into System.Web.Security class for this but have
> not been able to find a piece of code or guidance of how to do it.
>
> Imran.
>




 
Reply With Quote
 
Imran Aziz
Guest
Posts: n/a
 
      08-02-2005
I cannot seem to find the container class for this property.

It surly is not the member of System.Web.Security or am I wrong?

Imran.

"Brock Allen" <> wrote in message
news: m...
> User.Identity.Name
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> Hello All,
>> I am new to .net. I want to use windows authentication to
>> authenticate
>> against the current logged in user on the client machine. I believe by
>> using
>> windows authentication method, the IIS will send me details of the
>> current logged in user at the client machine if integrated windows
>> authentication is enabled at IIS. Can anyone please guide me how I can
>> get the name of the current logged in client that is making a request
>> to my ASP.net application ?
>>
>> I am trying to look into System.Web.Security class for this but have
>> not been able to find a piece of code or guidance of how to do it.
>>
>> Imran.
>>

>
>
>



 
Reply With Quote
 
Brock Allen
Guest
Posts: n/a
 
      08-02-2005
This was in the context of a Control or the Page. Another way is to call:

HttpContext.Current.User.Identity.Name

-Brock
DevelopMentor
http://staff.develop.com/ballen



> I cannot seem to find the container class for this property.
>
> It surly is not the member of System.Web.Security or am I wrong?
>
> Imran.
>
> "Brock Allen" <> wrote in message
> news: m...
>
>> User.Identity.Name
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>> Hello All,
>>> I am new to .net. I want to use windows authentication to
>>> authenticate
>>> against the current logged in user on the client machine. I believe
>>> by
>>> using
>>> windows authentication method, the IIS will send me details of the
>>> current logged in user at the client machine if integrated windows
>>> authentication is enabled at IIS. Can anyone please guide me how I
>>> can
>>> get the name of the current logged in client that is making a
>>> request
>>> to my ASP.net application ?
>>> I am trying to look into System.Web.Security class for this but have
>>> not been able to find a piece of code or guidance of how to do it.
>>>
>>> Imran.
>>>




 
Reply With Quote
 
Imran Aziz
Guest
Posts: n/a
 
      08-02-2005
Brock thanks a lot for that, it does give me the login name along with the
domain prefix.
Thanks.

"Brock Allen" <> wrote in message
news: m...
> This was in the context of a Control or the Page. Another way is to call:
>
> HttpContext.Current.User.Identity.Name
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> I cannot seem to find the container class for this property.
>>
>> It surly is not the member of System.Web.Security or am I wrong?
>>
>> Imran.
>>
>> "Brock Allen" <> wrote in message
>> news: m...
>>
>>> User.Identity.Name
>>>
>>> -Brock
>>> DevelopMentor
>>> http://staff.develop.com/ballen
>>>> Hello All,
>>>> I am new to .net. I want to use windows authentication to
>>>> authenticate
>>>> against the current logged in user on the client machine. I believe
>>>> by
>>>> using
>>>> windows authentication method, the IIS will send me details of the
>>>> current logged in user at the client machine if integrated windows
>>>> authentication is enabled at IIS. Can anyone please guide me how I
>>>> can
>>>> get the name of the current logged in client that is making a
>>>> request
>>>> to my ASP.net application ?
>>>> I am trying to look into System.Web.Security class for this but have
>>>> not been able to find a piece of code or guidance of how to do it.
>>>>
>>>> Imran.
>>>>

>
>
>



 
Reply With Quote
 
Jim in Arizona
Guest
Posts: n/a
 
      08-02-2005
"Imran Aziz" <> wrote in message
news:...
> Hello All,
> I am new to .net. I want to use windows authentication to authenticate
> against the current logged in user on the client machine. I believe by
> using windows authentication method, the IIS will send me details of the
> current logged in user at the client machine if integrated windows
> authentication is enabled at IIS. Can anyone please guide me how I can get
> the name of the current logged in client that is making a request to my
> ASP.net application ?
>
> I am trying to look into System.Web.Security class for this but have not
> been able to find a piece of code or guidance of how to do it.
>
> Imran.


I used this in my ASP pages and still use it in ASP.NET although there's
obviously many other was to achieve the same/similar result.

Dim strWho as String
strWho = Request.ServerVariables("AUTH_USER")
or
strWho = Request.ServerVariables("LOGON_USER")

HTH,
Jim


 
Reply With Quote
 
Pat
Guest
Posts: n/a
 
      08-29-2005
Yeah it would give the Domain prefix like DOMAIN\Username.
If you are authenticated in the domain.Whan you can do is to remove the
Domain prefix if you don't need it.
Patrick


"Imran Aziz" <> wrote in message
news:...
> Brock thanks a lot for that, it does give me the login name along with the
> domain prefix.
> Thanks.
>
> "Brock Allen" <> wrote in message
> news: m...
> > This was in the context of a Control or the Page. Another way is to

call:
> >
> > HttpContext.Current.User.Identity.Name
> >
> > -Brock
> > DevelopMentor
> > http://staff.develop.com/ballen
> >
> >
> >
> >> I cannot seem to find the container class for this property.
> >>
> >> It surly is not the member of System.Web.Security or am I wrong?
> >>
> >> Imran.
> >>
> >> "Brock Allen" <> wrote in message
> >> news: m...
> >>
> >>> User.Identity.Name
> >>>
> >>> -Brock
> >>> DevelopMentor
> >>> http://staff.develop.com/ballen
> >>>> Hello All,
> >>>> I am new to .net. I want to use windows authentication to
> >>>> authenticate
> >>>> against the current logged in user on the client machine. I believe
> >>>> by
> >>>> using
> >>>> windows authentication method, the IIS will send me details of the
> >>>> current logged in user at the client machine if integrated windows
> >>>> authentication is enabled at IIS. Can anyone please guide me how I
> >>>> can
> >>>> get the name of the current logged in client that is making a
> >>>> request
> >>>> to my ASP.net application ?
> >>>> I am trying to look into System.Web.Security class for this but have
> >>>> not been able to find a piece of code or guidance of how to do it.
> >>>>
> >>>> Imran.
> >>>>

> >
> >
> >

>
>



 
Reply With Quote
 
Pat
Guest
Posts: n/a
 
      08-29-2005
Thas true jim that will still do the trick in ASP.NET

"Jim in Arizona" <> wrote in message
news:...
> "Imran Aziz" <> wrote in message
> news:...
> > Hello All,
> > I am new to .net. I want to use windows authentication to authenticate
> > against the current logged in user on the client machine. I believe by
> > using windows authentication method, the IIS will send me details of the
> > current logged in user at the client machine if integrated windows
> > authentication is enabled at IIS. Can anyone please guide me how I can

get
> > the name of the current logged in client that is making a request to my
> > ASP.net application ?
> >
> > I am trying to look into System.Web.Security class for this but have not
> > been able to find a piece of code or guidance of how to do it.
> >
> > Imran.

>
> I used this in my ASP pages and still use it in ASP.NET although there's
> obviously many other was to achieve the same/similar result.
>
> Dim strWho as String
> strWho = Request.ServerVariables("AUTH_USER")
> or
> strWho = Request.ServerVariables("LOGON_USER")
>
> HTH,
> Jim
>
>



 
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
Windows - Get current logged user Rodrigo Bermejo Ruby 13 10-23-2007 11:14 PM
Serious issue: parts of my page render as not logged in, parts as logged in. Help! pcloches@gmail.com ASP .Net 1 04-12-2007 12:50 AM
How to get the Windows current logged user name using ASP mvr ASP General 5 05-16-2006 06:44 PM
LoginView does not show a logged in user as being logged in keithb ASP .Net 0 02-16-2006 05:20 PM
How can I get the current logged user information Shaminda Illangantilaka ASP .Net Security 2 01-25-2006 11:15 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57