I need to call my custom .Net 6 core web api from on-premise sharepoint 2019 webpart. The users are already being authenticated using on-premise Active Directory. I want to pass the authentication token that users receive when they first login to SharePoint to the WebApi to make sure that users are already authenticated. Currently, if I am implementing Active Directory authentication for Web API, users are getting the login prompt for credentials again when APIs are called using Axios.
There are already some similar questions and answers on this forum, but they have mentioned AAD (Azure Active Directory), which we cannot currently use.