How to pass through the currently logged user Windows domain user to a back-end PHP web from a WinForms app?
- The user logs in Windows using a (non-Azure) Active Directory account.
- The user starts our bespoken WinForms app written in C#/.NET Framework 4.8.
- The app calls
System.Security.Principal.WindowsIdentity.GetCurrent()to get the user's identity. - The app calls our bespoken back-end web service written in PHP 8.1. The app should authenticate against the web site as the user currently logged in.
The web service is deployed as an IIS/FastCGI web site.
The PHP code already supports Windows Authentication workflow if the user accesses the web site directly, using the IIS's native Windows Authentication workflow - PHP sends a 401/Negotiate response and receives the user's login from the web server, letting the browser and IIS to process the negotiation.
- Is it achievable to (securely) pass through the Windows Identity from the WinForms app to the IIS/PHP back-end?
- How to call the back-end PHP / negotiate the identity with it?