[英]Microsoft Graph API roles claim not in token but Application permissions added
我正在嘗試連接到 Microsoft Graph API 以使用 excel function 作為服務器到服務器的連接/流。 https://learn.microsoft.com/en-us/graph/excel-use-functions
在 Azure AD 中,我構建了注冊應用程序:
我已經創建了秘密...並且還添加了 API 權限。
在 Postman 中,我能夠很好地獲得令牌......但我注意到令牌中不包含角色。 這是請求:
然后當我向 RATE 的 excel function 發出請求時,我收到此錯誤:
{
"error": {
"code": "AccessDenied",
"message": "Either scp or roles claim need to be present in the token.",
"innerError": {
"date": "2021-08-17T14:31:04",
"request-id": "b0d65e3c-4acd-4a8a-82c4-1c4c5f2216ac",
"client-request-id": "b0d65e3c-4acd-4a8a-82c4-1c4c5f2216ac"
}
}
}
我仍然在這里的每篇文章都提到了 API 權限並以管理員身份授予同意....我已經完成但我仍然收到錯誤。 有什么想法嗎?
請檢查是否有任何聲明映射策略鏈接到應用程序服務主體。
Get-AzureADServicePrincipalPolicy -Id object_id_copied_in_step_1 | fl
Get-AzureADServicePrincipalPolicy -Id object_id_copied_in_step_1 | fl
檢查是否有鏈接的聲明映射策略。Remove-AzureADServicePrincipalPolicy
以刪除該策略。在https://jwt.ms解碼您的不記名令牌以確認 Roles 聲明是否已填充。 在這種情況下不會填充 SCP 聲明,因為它只會在用戶上下文中獲取令牌時填充。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.