0

How to pass through the currently logged user Windows domain user to a back-end PHP web from a WinForms app?

  1. The user logs in Windows using a (non-Azure) Active Directory account.
  2. The user starts our bespoken WinForms app written in C#/.NET Framework 4.8.
  3. The app calls System.Security.Principal.WindowsIdentity.GetCurrent() to get the user's identity.
  4. 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.

  1. Is it achievable to (securely) pass through the Windows Identity from the WinForms app to the IIS/PHP back-end?
  2. How to call the back-end PHP / negotiate the identity with it?
alik
  • 2,074
  • 1
  • 27
  • 39
  • 1
    Does this answer your question? [Making a web request to a web page which requires windows authentication](https://stackoverflow.com/questions/3562979/making-a-web-request-to-a-web-page-which-requires-windows-authentication) Also https://stackoverflow.com/questions/12212116/how-to-get-httpclient-to-pass-credentials-along-with-the-request – Charlieface Jan 03 '22 at 14:56

0 Answers0