?
Solved

Windows Authentication using Application Pool

Posted on 2008-06-16
2
Medium Priority
?
767 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
ajitha75 earned 2000 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

765 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