我们开发了一个小的SharePoint Framework WebPart(SPFx) . WebPart应该从我们自己的服务器上的自定义API获取他的数据 . api用AzureAD保护 . 我们已经尝试过这个:https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/connect-to-api-secured-with-aad和本教程:https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient但不幸的是,这些都不适合我们 . 我们已经做了什么: - 我们的自定义API已在AzureAD中的应用程序注册下的AzureAD中注册 . - 在Office 365 SharePoint中,我们在SharePoint管理员部分中批准了API .

api也必须在Azure中托管,或者如果它在我们自己的服务器上就可以了吗?我们收到警告:访问从原点'https://sharepoint.com ' has been blocked by CORS policy: No ' Access-Control-Allow-Origin ' header is present on the requested resource. If an opaque response serves your needs, set the request' s模式获取'no-cors'以获取禁用CORS的资源 .