【问题标题】:Restrict resources access in office 365 during OAuth在 OAuth 期间限制 Office 365 中的资源访问
【发布时间】:2016-09-20 16:22:22
【问题描述】:

我们有一个使用 Azure AD 与 Office 365 进行 OAuth 的 Web 应用程序。我们正试图限制我们可以访问的资源。 示例:身份验证用户可以访问 Site1、Site2 和 Site3。我们只想限制我们的应用程序访问 Site1。有谁知道这是否可能?我尝试查看 Office 365、Azure AD 甚至 Discovery API 文档,但找不到任何有用的信息。

【问题讨论】:

    标签: oauth-2.0 office365 azure-active-directory


    【解决方案1】:

    您是否还在 Azure AD 上注册了 site1、site2 和 site3?如果我理解正确,我们可以为 site1、site2 和 site 3 配置应用清单来设置如下所示的 require 权限(参考here

    "oauth2Permissions": [
    {
        "adminConsentDescription": "Allow the application full access to the Todo List service on behalf of the signed-in   user",
        "adminConsentDisplayName": "Have full access to the Todo List service",
        "id": "b69ee3c9-c40d-4f2a-ac80-961cd1534e40",
        "isEnabled": true,
        "type": "User",
        "userConsentDescription": "Allow the application full access to the todo service on your behalf",
        "userConsentDisplayName": "Have full access to the todo service",
        "value": "user_impersonation"
        }
    ],
    

    然后我们需要将具有正确权限的 Web 应用程序分配为 Microsoft 构建服务,如下图所示:

    最后一步是site1、site2、site3需要通过分析access token中的scope来验证请求是否有访问资源的权限。

    【讨论】:

      【解决方案2】:

      为了按用户管理授权,您应该实施角色基础访问控制,在此链接中您将找到使用 Azure AD https://github.com/Azure-Samples/active-directory-dotnet-webapp-roleclaims 的示例

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-01-24
        • 1970-01-01
        • 1970-01-01
        • 2013-08-28
        • 2021-07-11
        • 1970-01-01
        • 2018-08-30
        • 2011-10-14
        相关资源
        最近更新 更多