Search code examples
c#asp.netauthenticationiiscscore

ASP.NET permission


I'm using ASP.NET to build a webpage that controls PC Sound Mixer (Windows 10).

In order to control the volume mixer i used the library: CSCore.CoreAudioAPI.

When I ran the web locally on IIS Express (started from VS) I could control the volume.

But, when I published the web to IIS, I couldn't control the volume anymore.

I did some research and found out that when I am connecting to the webpage I'm not authenticated as the current user on the domain.

Therefore, I would like to ask if it is possible to connect to the webpage as the system current user, so I will be able to control the volume mixer for the user who I'm working on.

Thank you for your help.


Solution

  • In IIS, you have two options: 1) Allow "impersonation" by using that setting in your web.config file. or 2) Change the (local) permissions for your page on IIS. You will need to look at the app pool, and set the identity there. One word of warning: running IIS under an identity with permission to change the volume could be risky. It makes your machine more vulnerable to hackers.