gpt4 book ai didi

azure - 在 Multi-Tenancy 应用程序中,如何检查在 azure 门户中注册应用程序的租户数据?

转载 作者:行者123 更新时间:2023-12-03 04:09:29 24 4
gpt4 key购买 nike

我有 2 个来自不同组织(租户)的 SharePoint 网站:

  • 租户 1:abc.sharepoint.com
  • 租户 2:xyz.sharepoint.com

已在 Tenan 1“abc.sharepoint.com”的 Azure 门户上注册并授予应用程序所需的权限,以便租户 2 用户“xyz.sharepoint.com”可以访问该应用程序

  • 身份验证工作正常
  • 当我通过租户 1“abc.sharepoint.com”的用户身份验证时,对共享点列表数据的访问可以正常进行

我希望通过租户2'xyz.sharepoint.com'的用户进行身份验证,您可以查阅sharepoint的数据,示例:

当我提出请求时:

  1. https://graph.microsoft.com/v1.0/sites/roothttps://graph.microsoft.com/v1.0/sites/xyz.sharepoint.com

    它返回的信息令人满意,因为它查询了“xyz.sharepoint.com”的网站,因为用户来自该租户

...但是当我咨询指定租户“abc.sharepoint.com”时

  • https://graph.microsoft.com/v1.0/sites/abc.sharepoint.com

    返回以下错误:

    {
    “错误”: {
    "code": "无效请求",
    "message": "此租户的主机名无效",
    “内部错误”:{
    “请求ID”:“c0a8fa51-245b-4d1e-bf0b-5f32b6c0eb26”,
    “日期”:“2019-08-17T16:27:57”
    }
    }
    }

  • 其中一个与另一个租户的用户进行了身份验证。如何查看应用程序注册的信息?

    最佳答案

    我们无法使用从一个租户获得的访问 token 来访问另一租户。

    如果您想这样做,您需要:

    1. 将租户 2“xyz.sharepoint.com”的用户作为访客添加到租户中1 'abc.sharepoint.com'。请参阅Quickstart: Add guest users to your directory in the Azure portal .
    2. 使用租户 1 的管理员帐户对租户 2 的 Azure AD 中注册的应用程序进行管理员同意。只需打开浏览器并向其发出请求
    https://login.microsoftonline.com/common/oauth2/authorize?client_id={client id of the app registered in Azure AD of Tenant 2}&response_type=code&redirect_uri={reply url of the app registered in Azure AD of Tenant 2}&nonce=1234&resource=https://graph.microsoft.com&prompt=admin_consent
  • 使用租户 1 的管理员帐户登录并点击“接受”。 Accept screenshot
  • 获取访问 token 并使用它来访问租户 1“abc.sharepoint.com”。
  • 关于azure - 在 Multi-Tenancy 应用程序中,如何检查在 azure 门户中注册应用程序的租户数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57538189/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com