Home » c# » c# – ASP.NET Web API Windows Authentication from Server to Server with specific domain account

c# – ASP.NET Web API Windows Authentication from Server to Server with specific domain account

Posted by: admin February 21, 2020 Leave a comment

Questions:

I have web app accessing an API server (A) with Windows authentication and I can successfully get a response. What I need to do is from server (A) to call another API server (B) with Windows authentication as well, but this time I would like to send a specific domain/user which configured in Server (A) IIS Security (Permission). Both servers are on the same domain.

Please see the diagram below:

enter image description here

Just would like to get some guidance/help on how to push dn/John from Server (A) to Server (B) from API code (C#).

I am using User.Identity.Name to capture the user in Server (B) to validate if dn/john is the user accessing but not sure how to send dn/john from Server A when I make HttpClient request to Server(B).

All servers resides on the same domain.

Please advise.

Thank you.

How to&Answers: