简体   繁体   English

Microsoft Azure AD oauth标识用户的角色和用户所属的组(组织单位)

[英]Microsoft Azure AD oauth identify user's role and group (orgunit) which user belong to

I am doing the oauth2 Azure AD. 我正在执行oauth2 Azure AD。 I am be able to authenticate user and list all the groups for a domain by using using this api reference 我可以使用此api参考对用户进行身份验证并列出域的所有组

https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/api-catalog https://msdn.microsoft.com/zh-CN/library/azure/ad/graph/api/api-catalog

I am having the issue which i really need some help on: 我遇到的问题我确实需要一些帮助:

1) When a user login i am not be able to identify user's role. 1)当用户登录时,我无法识别用户的角色。 In google only admin/delegate admin have permission to list groups thus we are using this to identify admin. 在google中,只有admin / delegate admin有权列出组,因此我们使用它来标识admin。 Unfortunately for Azure AD normal user also can list groups as well. 不幸的是,对于Azure AD,普通用户也可以列出组。 I want to be able to see if user role is User, User Admin, Password Admin etc 我希望能够查看用户角色是否为用户,用户管理员,密码管理员等 在此处输入图片说明

2) Need a way to get the group (orgunit) which user belong to. 2)需要一种方法来获取用户所属的组(组织单位)。 I went through the api link (above) several times but not be able to find something helpful. 我多次浏览了api链接,但是找不到有用的东西。 i did try to set up a local Active Directory where i setup the orgunit and sync over to Azure AD. 我确实尝试设置本地Active Directory,在其中设置组织单位并同步到Azure AD。 But consistently i see department is null. 但是一直以来,我看到部门是空的。

1) When a user login i am not be able to identify user's role. 1)当用户登录时,我无法识别用户的角色。 In google only admin/delegate admin have permission to list groups thus we are using this to identify admin. 在google中,只有admin / delegate admin有权列出组,因此我们使用它来标识admin。 Unfortunately for Azure AD normal user also can list groups as well. 不幸的是,对于Azure AD,普通用户也可以列出组。

The Group.Read.All scope require the Administrator Consent. Group.Read.All范围需要管理员同意。 However the administrator could grant the consent for the organization. 但是,管理员可以为组织授予同意。 Then the normal user also could list the groups. 然后普通用户也可以列出组。 Please refer Azure consent framework here 在此处参考Azure同意框架

2) Need a way to get the group (orgunit) which user belong to. 2)需要一种方法来获取用户所属的组(组织单位)。 I went through the api link (above) several times but not be able to find something helpful 我多次(上面)通过了api链接,但找不到有用的东西

You can use rest below to get a user's group and directory role memberships 您可以在下面使用rest来获取用户的组和目录角色成员身份

GET https://graph.windows.net/myorganization/users/{user_id}/$links/memberOf?api-version

Refer GetUserMemberShips . 请参阅GetUserMemberShips

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM