By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Figuring out who the user is

P: n/a
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.
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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"
Jun 27 '08 #2

P: n/a
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.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.