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.

Re: Figuring out who the user is by Bob

Bob
Wed May 21 04:37:52 CDT 2008

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"



RE: Figuring out who the user is by Joy

Joy
Wed May 21 05:44:00 CDT 2008

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.
>