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

问题描述

我需要创建一个通用应用窗口10 ,允许用户保存在自己的OneDrive业务考虑到他的文件。

我读,我需要注册与Azure的活动目录(开发者帐户)的应用程序,然后请求OneDrive权限业务。

不过:

问题1 :如果应用程序被设置为Azure的AD多租户,每个用户将自己的文件存储在自己的企业帐户onedrive

用户登录:[email protected] ---> onedrive企业帐户contoso.onmicrosoft.com

用户登录:[email protected] - > onedrive企业帐户:otherbusiness.onmicrosoft.com

等。

问题2:,然后,当我们调用API URL和应用程序是多租户,可以放什么房客在这里:

https://开头的 {}租户 -my.sharepoint.com/_api/v2.0


解决方案

问题1

如果您声明您的应用程序的多租户,您的组织(例如contoso.onmicrosoft.com)将成为应用程序的所有者。然后,其他组织租户(例如awesomebusiness1.onmicrosoft.com,awesomebusiness2.onmicrosoft.com等)将能够与您的应用程序进行身份验证。认证工作将在你的AzureAD你会看到awesomebusiness1和awesomebusiness2的这是你的应用程序的用户的用户。
然后,连接的用户的onedrive企业账户将[email protected]如果李四与您的多租户应用验证。

问题2

大多数Office365阿比图形API的不包括承租人的名字。例如参见。的确,这简化了REST请求的创建。然而,在你的情况,如果你需要有针对性的SharePoint网站的URL,这将是你的责任,以动态地创建它。当用户连接您检索其租户的名称(例如awesomebusiness2)和创建URL(如)

I need to create an universal app windows 10 that allow users save his files in his own OneDrive Business account.

I read that I need to register the app with Azure Active Directory (developer account) and then request permissions for OneDrive for Business.

But:

Question1: if app is set as "multi-tenant" in Azure AD, every user will store his files in his own business account onedrive?

user logged: [email protected] ---> onedrive business account contoso.onmicrosoft.com

user logged: [email protected] --> onedrive business account: otherbusiness.onmicrosoft.com

etc.

Question 2: then, when we call api url and app is multi-tenant, what tenant can put here:

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

解决方案

Question 1

If you declare your app as multi-tenant, your organisation (e.g. contoso.onmicrosoft.com) will be the owner of the application. Then, other organisation tenants (e.g. awesomebusiness1.onmicrosoft.com, awesomebusiness2.onmicrosoft.com etc.) will be able to authenticate with your app. The authentication will work and in your AzureAD you will see the users of awesomebusiness1 and awesomebusiness2 which are users of your app.Then, the onedrive business account of the connected user will be [email protected] if John Doe is authenticated with your multitenant app.

Question2

Most of the Office365 Api and Graph api do not include the name of the tenant. For example see this documentation. Indeed, this simplifies the creation of the REST request. However, in your case, if you need the url of the targeted sharepoint site, that will be your responsibility to create it dynamically. When the user connects your retrieve the name of its tenant (e.g. awesomebusiness2) and create the url (e.g. https://awesomebusiness2-my.sharepoint.com/_api/v2.0)

这篇关于多租户应用程序 - OneDrive业务API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 12:21