Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从SharePoint页面调用Web API,即不是SharePoint加载项_Sharepoint_Asp.net Web Api_Office365_Jwt - Fatal编程技术网

从SharePoint页面调用Web API,即不是SharePoint加载项

从SharePoint页面调用Web API,即不是SharePoint加载项,sharepoint,asp.net-web-api,office365,jwt,Sharepoint,Asp.net Web Api,Office365,Jwt,我已经成功地遵循了来自的说明,创建并发布了一个Web API项目 我还测试了访问我的服务的根url,并正确地提示我首先登录,然后我能够从通过[Authorize]属性保护的端点返回结果 Web API实例与我的SharePoint Online网站处于同一租约中。现在,我想使用代码片段Web部件从SharePoint中的页面调用API。我已经添加了一些代码来调用API,并且正在返回一个302重定向到id]/oauth2/authorize?response\u type=id\u-token&r

我已经成功地遵循了来自的说明,创建并发布了一个Web API项目

我还测试了访问我的服务的根url,并正确地提示我首先登录,然后我能够从通过[Authorize]属性保护的端点返回结果

Web API实例与我的SharePoint Online网站处于同一租约中。现在,我想使用代码片段Web部件从SharePoint中的页面调用API。我已经添加了一些代码来调用API,并且正在返回一个302重定向到id]/oauth2/authorize?response\u type=id\u-token&redirect\u-uri=。。。因此,它似乎正在尝试执行登录

我的问题:由于SharePoint和Web API共享同一个Azure AD实例,如何通过Javascript将已登录用户的令牌转发到API

由于SharePoint和Web API共享同一个Azure AD实例,如何通过JavaScript将已登录用户的令牌转发到API

SharePoint Online和Web API均受Azure AD保护,但令牌不能在应用程序之间共享

在这种情况下,可以考虑在Azure广告中为Web应用程序配置单点登录(SSO),以避免用户重复输入用户名和密码。


是web API服务配置为SSO。但是,第二部分要求客户机(在本例中为SharePoint)设置为具有对服务的委派权限。Azure AD中的SharePoint应用程序已禁用配置选项。我如何解决此问题?