I'm currently working on an ASP.Net / C# / Entity Framework project using Windows Authentication.
I would like my users to reach both IIS Server and SQL Server with their own Active Directory account, allowing administrators to see who is connected to the database.
But I have an issue: while connecting to the database, the program uses the application pool's account set up in the IIS Server, but not his user account.
This is my web.config file :
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5.2"/>
<httpRuntime targetFramework="4.5.2"/>
<customErrors mode="Off"/>
<authentication mode="Windows"/>
<identity impersonate="true"/>
</system.web>
<connectionStrings>
<add name="BOMBuilderEntities"
connectionString="metadata=
res://*/Model.BOMBuilderModel.csdl|
res://*/Model.BOMBuilderModel.ssdl|
res://*/Model.BOMBuilderModel.msl;
provider=System.Data.SqlClient;
provider connection string=
'data source=FRSDSQ01;
initial catalog=BOMBuilder;
integrated security=SSPI;
MultipleActiveResultSets=True;
App=EntityFramework'"
providerName="System.Data.EntityClient"/>
</connectionStrings>
<system.webServer>
<defaultDocument>
<files>
<add value="multipages.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Also, I tried to modify this ApplicationPoolIdentity setting to see if it was this connection used for SQL Server authentication and it is. If I set a domain account, this account will be listed in the activity monitor. So how can I set this setting in order to use the user account logged on my asp.net application?
EDIT 1: I've added the impersonation setting.