Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Security (http://www.velocityreviews.com/forums/f62-asp-net-security.html)
-   -   Get the current logged in user name (http://www.velocityreviews.com/forums/t767731-get-the-current-logged-in-user-name.html)

Imran Aziz 08-02-2005 01:01 PM

Get the current logged in user name
 
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.



Nicole Calinoiu 08-02-2005 01:07 PM

Re: Get the current logged in user name
 
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" <imran@tb2.net> wrote in message
news:u18ZSH2lFHA.320@TK2MSFTNGP09.phx.gbl...
> 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.
>




Brock Allen 08-02-2005 01:24 PM

Re: Get the current logged in user name
 
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.
>





Imran Aziz 08-02-2005 02:02 PM

Re: Get the current logged in user name
 
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" <ballen@NOSPAMdevelop.com> wrote in message
news:1052407632585714395312500@msnews.microsoft.co 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.
>>

>
>
>




Brock Allen 08-02-2005 03:20 PM

Re: Get the current logged in user name
 
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" <ballen@NOSPAMdevelop.com> wrote in message
> news:1052407632585714395312500@msnews.microsoft.co 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.
>>>





Imran Aziz 08-02-2005 03:44 PM

Re: Get the current logged in user name
 
Brock thanks a lot for that, it does give me the login name along with the
domain prefix.
Thanks.

"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:1053276632585784348281250@msnews.microsoft.co 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" <ballen@NOSPAMdevelop.com> wrote in message
>> news:1052407632585714395312500@msnews.microsoft.co 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.
>>>>

>
>
>




Jim in Arizona 08-02-2005 11:12 PM

Re: Get the current logged in user name
 
"Imran Aziz" <imran@tb2.net> wrote in message
news:u18ZSH2lFHA.320@TK2MSFTNGP09.phx.gbl...
> 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



Pat 08-29-2005 03:53 AM

Re: Get the current logged in user name
 
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" <imran@tb2.net> wrote in message
news:OGiISi3lFHA.420@TK2MSFTNGP09.phx.gbl...
> Brock thanks a lot for that, it does give me the login name along with the
> domain prefix.
> Thanks.
>
> "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
> news:1053276632585784348281250@msnews.microsoft.co 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" <ballen@NOSPAMdevelop.com> wrote in message
> >> news:1052407632585714395312500@msnews.microsoft.co 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.
> >>>>

> >
> >
> >

>
>




Pat 08-29-2005 03:54 AM

Re: Get the current logged in user name
 
Thas true jim that will still do the trick in ASP.NET

"Jim in Arizona" <tiltowait@hotmail.com> wrote in message
news:e0Rzte7lFHA.1412@TK2MSFTNGP09.phx.gbl...
> "Imran Aziz" <imran@tb2.net> wrote in message
> news:u18ZSH2lFHA.320@TK2MSFTNGP09.phx.gbl...
> > 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
>
>





All times are GMT. The time now is 03:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.