2016-05-23 56 views
0

我們有一個Web應用程序,使用Azure AD與Office 365進行OAuth。我們正試圖限制我們有權訪問的資源。 示例:認證用戶可以訪問Site1,Site2和Site3。我們只想限制我們對Site1的應用程序訪問。有誰知道這是否可能?我試圖通過Office 365,Azure AD,甚至是Discovery API文檔,但我找不到任何有用的信息。在OAuth期間限制辦公室365中的資源訪問

回答

0

您是否還在Azure AD上註冊了site1,site2和site3?如果我理解正確的話,我們可以配置爲SITE1,SITE2與本站3設置需要許可像下面的應用程序清單(見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構建服務如下圖所示: enter image description here

最後一步是,site1,site2,site3需要通過分析訪問令牌中的作用域來驗證請求是否具有訪問資源的權限。