Muh*_*eed 4 oauth access-control azure oauth-2.0 azure-active-directory
我正在使用Azure Active Directory,并尝试了解此处描述的三种类型的访问控制.每种方法的优点和缺点是什么?何时使用它们:
基于范围的访问控制使用oauth2Permissions我的清单部分,我可以添加读写权限,如下所示:
{
"adminConsentDescription": "Allow the application read access to MyApi on behalf of the signed-in user.",
"adminConsentDisplayName": "Read access to MyApi",
"id": "56d944c0-f3aa-4f80-9472-9c1414383abf",
"isEnabled": true,
"type": "User",
"userConsentDescription": "Allow the application read access to MyApi on your behalf.",
"userConsentDisplayName": "Read access to MyApi",
"value": "read_my_api"
},
{
"adminConsentDescription": "Allow the application write access to MyApi on behalf of the signed-in user.",
"adminConsentDisplayName": "Write access to MyApi",
"id": "6d66a2bd-c8c7-4ee0-aef4-9424b51b4967",
"isEnabled": true,
"type": "User",
"userConsentDescription": "Allow the application write access to MyApi on your behalf.",
"userConsentDisplayName": "Write access to MyApi",
"value": "write_my_api"
}
基于角色的访问控制(RBAC) - 使用appRoles我的清单部分.
groupMembershipClaims我的清单部分进行基于组的访问控制.Mvd*_*vdD 11
我认为范围和角色/组之间最显着的区别在于谁决定允许客户端做什么.
当外部应用程序想要通过公开的API访问用户的数据时,通常会使用范围.它们确定客户端应用程序可以执行的操作
基于角色或组的访问通常在应用程序中用于确定用户可以执行的操作.
最受欢迎的两种:
if (User.IsInRole("SuperAdmin")) {...}| 归档时间: |
|
| 查看次数: |
1299 次 |
| 最近记录: |