473,408 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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.
Jun 27 '08 #1
2 1571
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Nathan Pinno | last post by:
Hi all, I need help figuring out how to fix my code. I'm using Python 2.2.3, and it keeps telling me invalid syntax in the if name == "Nathan" line. Here is the code if you need it. #This...
19
by: darrel | last post by:
On my vb.net page, I have 4 sets of inputs + form buttons. example: Search: (GO) Zip: (GO) County: (GO) County: (GO) The problem is if I go to the page, type in a zip code, and hit...
5
by: booner | last post by:
I have a table (user) ip, ssn, date,name Each time the user does something, I record that information in the table. I'd like get a list of the last 4 entries for distinct ssn. I started...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.