Home:ALL Converter>Use Sharepoint Windows Authentication for Rest API

Use Sharepoint Windows Authentication for Rest API

Ask Time:2018-10-09T14:55:23         Author:Fütty

Json Formatter

I have a problem, I can't figure out how to solve it. I have a Sharepoint with windows authentication. Inside the Sharepoint are several webparts, that should consume a rest api (.net core, not Sharepoint api) by javascript ajax calls. At the rest api, the user should get authenticated with the same user name as in Sharepoint. Simply enabling windows authentication and setting xhrFields.withCredentials seams not to work. The user gets authenticated in the rest api, but if I switch the user in Sharepoint, the user in the rest api doesn't change.

Thanks in advance for any help.

Author:Fütty,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52714981/use-sharepoint-windows-authentication-for-rest-api
yy