我正在尝试授予控制台应用调用 Azure AD 中的 API 的权限。
当我转到“添加权限”时,“应用程序权限”显示为灰色,我只能选择“委派权限”。
我的理解是应用程序权限适合控制台应用程序,因为它在后端运行并且用户不登录它。
来自“应用程序权限”的帮助文本:
Your application runs as a background service or daemon without a signed-in user.
“委派权限”的帮助文本:
Your application needs to access the API as the signed-in user.
为什么“应用程序权限”被禁用?
最佳答案
据我了解,您正在公开受 Azure AD 保护的自定义 api。如果是这样,您需要define the application permission通过编辑 api 应用程序的 list 。
list :
"appRoles": [
{
"allowedMemberTypes": [
"Application"
],
"description": "Apps that have this role have the ability to invoke my API",
"displayName": "Can invoke my API",
"id": "fc803414-3c61-4ebc-a5e5-cd1675c14bbb",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "myTestRole"
}
]
然后就会显示应用程序的权限。
关于azure - 为什么 "Application permissions"在 Azure AD 的 "Request API permissions"中被禁用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57379397/