【发布时间】:2021-11-17 15:48:14
【问题描述】:
我在 Angular 中创建了一个项目。我需要从 SharePoint 列表中获取/发布数据。
我已经创建了 Microsoft Graph API 应用来实现同样的目的。
当我尝试使用 Postman 在 SharePoint 列表中获取/发布数据时。它工作正常。
但是当我在 Angular 中集成该代码并在 localhost 上运行该项目时,会出现以下错误。
“从源 'http://localhost:4200' 访问 'https://login.microsoftonline.com/{ {directoryId}}/oauth2/v2.0/token' 的 XMLHttpRequest 已被 CORS 策略阻止: 请求的资源上不存在“Access-Control-Allow-Origin”标头。”
【问题讨论】:
标签: angular azure-active-directory microsoft-graph-api localhost sharepoint-online