Figuring out who the user is

This is a discussion on Figuring out who the user is within the Inetserver forums in Microsoft Tools category; Hello.. I'm using windows integrated security, with the following web.config: <authentication mode="Windows"/> <identity impersonate="true" userName="netuser" password="p"/> And I am trying to figure out who is the actual human user sitting at the keyboard. With WindowsIdentity, I can find out all there is to know about the "netuser" account, but I need to know the signin name of the user who is actually logged into the domain. Is this possible? Thanks....

Go Back   Application Development Forum > Microsoft Tools > Inetserver

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 05-20-2008, 09:33 PM
Jon Mcleod
Guest
 
Default Figuring out who the user is

Hello..

I'm using windows integrated security, with the following web.config:

<authentication mode="Windows"/>
<identity impersonate="true" userName="netuser" password="p"/>

And I am trying to figure out who is the actual human user sitting at
the keyboard. With WindowsIdentity, I can find out all there is to know
about the "netuser" account, but I need to know the signin name of the
user who is actually logged into the domain.

Is this possible?

Thanks.
Reply With Quote
  #2  
Old 05-21-2008, 05:37 AM
Bob Barrows [MVP]
Guest
 
Default Re: Figuring out who the user is

Jon Mcleod wrote:
> Hello..
>
> I'm using windows integrated security, with the following web.config:
>
> <authentication mode="Windows"/>
> <identity impersonate="true" userName="netuser" password="p"/>
>


There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic (COM-based) asp newsgroup.
ASP.Net bears very little resemblance to classic ASP so, while you may be
lucky enough to find a dotnet-knowledgeable person here who can answer your
question, you can eliminate the luck factor by posting your question to a
group where those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet or the forums at www.asp.net.

> And I am trying to figure out who is the actual human user sitting at
> the keyboard. With WindowsIdentity, I can find out all there is to
> know about the "netuser" account, but I need to know the signin name
> of the user who is actually logged into the domain.
>

Maybe from the IIS logs?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Reply With Quote
  #3  
Old 05-21-2008, 06:44 AM
Joy
Guest
 
Default RE: Figuring out who the user is

Hi Jon,
Please follow the steps given below:
1. Apart from whatever setting you are currently having in Web.config, also
add the these lines just below the authentication mode setting.
<authorization>
<deny users="?"/>
</authorization>
2. Then in the code behind page of your web page add the following code:

Dim User As System.Security.Principal.IPrincipal
User = System.Web.HttpContext.Current.User

Dim username As String
username = User.Identity.Name

Response.Write("This is the current logged in user: " & username)

I have created an application to test the code and it works fine for me.

regards,
Joy

"Jon Mcleod" wrote:

> Hello..
>
> I'm using windows integrated security, with the following web.config:
>
> <authentication mode="Windows"/>
> <identity impersonate="true" userName="netuser" password="p"/>
>
> And I am trying to figure out who is the actual human user sitting at
> the keyboard. With WindowsIdentity, I can find out all there is to know
> about the "netuser" account, but I need to know the signin name of the
> user who is actually logged into the domain.
>
> Is this possible?
>
> Thanks.
>

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:18 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.