来自多租户应用程序的Sharepoint REST API访问 [英] Sharepoint REST API access from multi-tenant app

查看:80
本文介绍了来自多租户应用程序的Sharepoint REST API访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过一些研究后我得出结论,我需要在Azure AD中使用2个应用才能运行多租户应用,因此我在Azure AD中配置了2个应用:


APP1:具有关联Sharepoint权限的多租户网络应用


APP2:具有APP1授权权限的本机应用


我能够使用APP2的client_id获取oauth代码和令牌。


(我假设我正在做的事情直到这里......如果没有请阻止我)



那么,根据
Files REST API
 文档,我必须调用: 

 https:/ /{tenant}-my.sharepoint.com/_api/v1.0/me 



问题是,租户在这里使用? 



解决方案


根据您的描述,我的理解是您希望使用Rest API从多租户应用访问。


据我所知,您应该获得APP1的客户端ID和令牌。然后,您可以作为租户访问应用域。


请求网址如下所示:

 https:// myappdomain .com / v1 / oauth2_redirect /?code = AAABAAAA ... {ONE-CODE-to-RULE-THEM-ALL} xyz 

以下是一些详细的文章供您参考:


http: //stackoverflow.com/questions/27303590/building-a-multi-tenant-app-for-sharepoint-online-o365


https://msdn.microsoft.com/en-us/library/office/jj687469.aspx


谢谢


最好的问候


论坛支持

请记得将回复标记为答案如果他们没有提供任何帮助,他们会帮助和取消标记。如果您对TechNet订阅者支持有反馈,请联系
tnmff@microsoft.com



After some research I have concluded that I need 2 apps in Azure AD in order to be able to run a multi-tenant app, so I configured 2 apps in Azure AD:

APP1: A multi-tenant web app with Sharepoint permissions associated

APP2: A native app with delegated permissions to APP1

I am able to get the oauth code and token using the client_id of APP2.

(I assume I am doing things right up to here... if not please stop me)

So then, according to the Files REST API documentation, I must invoke to: 

https://{tenant}-my.sharepoint.com/_api/v1.0/me


The question is, which tenant to use here? 

解决方案

Hi,

According to your description, my understanding is that you want to access from multi-tenant app using Rest API.

Per my knowledge, you should get the Client ID and token of APP1. Then you can access the app domain as the tenant.

The request url looks like below:

https://myappdomain.com/v1/oauth2_redirect/?code=AAABAAAA...{ONE-CODE-To-RULE-THEM-ALL}xyz

Here are some detailed articles for your reference:

http://stackoverflow.com/questions/27303590/building-a-multi-tenant-app-for-sharepoint-online-o365

https://msdn.microsoft.com/en-us/library/office/jj687469.aspx

Thanks

Best Regards

Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


这篇关于来自多租户应用程序的Sharepoint REST API访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆