I set up an ASP.NET web site. I set as many settings as I know how to set to my personal user account, including:
- The app pool identity is set to my personal user account.
- Authentication for both "Anonymous" and "ASP.NET Impersonation" settings are set explicitly to target my personal user account, and both are enabled.
When the web app executes a request, it invokes PowerShell to run the 'git config' command. When invoking PowerShell, I also specify the invocation option to FlowImpersonationPolicy, just to try to be sure the correct identity makes it all the way to git. At runtime, just before PowerShell is invoked by the web app, the value of System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString()
is indeed my user account.
The problem is that the output of 'git config' is different when I run the app in visual studio vs when I run it hosted on my local IIS instance, which is configured as I described above. When I run the web app in Visual Studio, the same identity appears as appears in IIS, but the output of git config is different.
When it runs git config --show-origin -l
from the Visual Studio-hosted version, I see that it's correctly picking up the global settings for my user account at "c:\users\myusername.gitconfig". However, when the same web app runs deployed under IIS, the command does not list configurations at that location.
So it seems like the git command is not running under or is not aware of my user account, even though everything appears to be invoked by my user account. Am I missing something?