To set user permissions for the Windows domain user
Using Windows administrative tools on the Web server computer, make sure that the mapped Windows domain user has necessary privileges. For details, see ASP.NET Required Access Control Lists (ACLs).
Mapping to the Windows User and Enabling Impersonation
After establishing the correct permissions for the ASPNET or NETWORK SERVICE user account and for the user to map to, you configure the application to impersonate that user.
To configure your Web application for integrated security
Open the Web.config file for your application and add the following elements:
<authentication mode="Windows" />
<identity impersonate="true" userName="domain\username" password="password"/>
The <authentication> element might already be there.
Note Elements in Web.config are case sensitive.
Using Windows Security in the Connection String
Finally, when you create connection strings for database access, configure them to use Windows integrated security.
To use Windows security in the connection string
When you create a connection string for your application, do not include a user name and password. Instead, set the connection string's Integrated Security attribute to SSPI.
The following example shows a connection string that includes the appropriate attributes:
data source=myserver;initial catalog=northwind;Integrated Security=SSPI
To configure SQL Server for integrated security
From the Windows Start menu, choose Microsoft SQL Server, and then choose Enterprise Manager.
Open the node for the server and expand the node for the database you want to give users permissions for.
Right-click the Users node and choose New Database User.
In the Database User Properties dialog box, enter domain\username in the Login name box, and then click OK.