Solved

Windows Authentication using Application Pool

Posted on 2008-06-16
2
760 Views
Last Modified: 2012-06-27
Hi

I'm not sure if this is an ASP.NET question or an IIS one, so I'll give it a go here first.

I have an application running on two servers. Server A hosts IIS and the ASP.NET application and Server B hosts the SQL Server database the application uses. We have to use Windows Authentication to access the SQL Server db so a service account has been created and the details entered into an Application Pool that has been created for the application on IIS.

This all works fine. The problem is that we need to capture the Windows Username of the browser user, but the following code returns the service account user setup in the Application Pool:-
WindowsIdentity.GetCurrent().Name

Is it possible to configure the setup so that the SQL Server is accessed with the service account but the actual user accessing the application via the browser also has their windows username accessible?

Thanks in advance.
0
Comment
Question by:justjuice
2 Comments
 
LVL 14

Accepted Solution

by:
ajitha75 earned 500 total points
ID: 21793586
Instead of WindowsIdentity.GetCurrent().Name use

System.Threading.Thread.CurrentPrincipal.Identity.Name
0
 
LVL 1

Author Closing Comment

by:justjuice
ID: 31467570
It works - thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now