如何从 AAD 图中的组名获取 groupId API

how to get the groupId from group name in AAD graph API

可以使用图 api 从组名中获取 groupId,我正在尝试验证用户是否属于 Azure Active Directory 中的安全组,但只知道组名位于一次,

我认为https://graph.windows.net/mytenantdomain/isMemberOf只支持groupId

感谢您的提问!您可以使用过滤器表达式查询 /groups 以获取组的 Group 对象,然后获取 objectId 属性 以用于 isMemberOf 函数。例如:

https://graph.windows.net/myorganization/groups?api-version=1.5&$filter=displayName%20eq%20'Example%20Group'

您可以在此处详细了解组的可过滤属性:https://msdn.microsoft.com/en-us/Library/Azure/Ad/Graph/api/entity-and-complex-type-reference#GroupEntity

希望对您有所帮助 - Jimaco