We can impersonate a user on a thread in ASP.NET, you can use the following methods.
Impersonate the IIS Authenticated Account or User
Include an <identity> tag in the Web.config file of this application and set the impersonate attribute to true. For example: <identity impersonate="true" />
Impersonate a Specific User for All the Requests of an ASP.NET Application.
Specify the userName and password attributes in the <identity> tag of the Web.config file for that application. For example: <identity impersonate="true" userName="accountname" password="password" />
Impersonate the Authenticating User in Code
To impersonate the authenticating user (User.Identity) only when you run a particular section of code, you can use the code to follow. This method requires that the authenticating user identity is of type WindowsIdentity