简体   繁体   English

Azure AD SCIM 属性映射 - 组成员关系表达式

[英]Azure AD SCIM Attribute Mapping - Group Membership Expression

I would like to create an expression for SCIM attribute mapping in Azure AD to pass a value to an attribute of the receiving application based on the user membership to a specific AD group.我想为 Azure AD 中的 SCIM 属性映射创建一个表达式,以根据特定 AD 组的用户成员身份将值传递给接收应用程序的属性。

The below expression, for example, passes value New to the attribute userType of the receiving application if the value of the Azure AD attribute user.department equals to hr_new , and passes the value Old if not.例如,下面的表达式如果 Azure AD 属性user.department的值等于hr_new ,则将值New传递给接收应用程序的属性userType ,否则传递值Old

IIF([department]="new_hr", "New", "Old")

See example settings below:请参阅下面的示例设置:

在此处输入图像描述

However, I haven't been able to query or check the group membership of a User in an expression in Azure AD.但是,我无法在 Azure AD 的表达式中查询或检查用户的组成员身份。 I would like to create an expression that checks if the user is member of group abc and if true it should pass the value X and if false , it should pass the value Y我想创建一个表达式来检查用户是否是组abc的成员,如果为true ,则应传递值X ,如果为false ,则应传递值Y

Any ideas how this could be done?任何想法如何做到这一点?

This is not possible at this time.目前这是不可能的。 Group membership is considered a property of the group object, and cannot be called into any logic expressions for user objects.组成员资格被认为是组 object 的属性,不能在任何用户对象的逻辑表达式中调用。

As advised by @ZollnerdMSFT, querying AD Group membership directly using Expressions is not possible at the moment in Azure.正如@ZollnerdMSFT 所建议的,目前在 Azure 中无法直接使用表达式查询 AD 组成员资格。 The solution was to use App roles .解决方案是使用App roles I added new App roles to the enterprise application in Azure and then assigned the desired app role to each Group.我在 Azure 中的企业应用程序中添加了新的应用程序角色,然后将所需的应用程序角色分配给每个组。 Users within the AD Group(s) inherit the app role assigned to the Group(s) they belong to. AD 组中的用户继承分配给他们所属组的应用角色。

These inherited App roles can then be queried using Expressions.然后可以使用表达式查询这些继承的App 角色 I then wrote an Expression to get the app roles that the user inherited and returned the desired value based on the app roles the user has - which implicitly reflects the user's Group membership(s).然后我编写了一个表达式来获取用户继承的应用程序角色,并根据用户拥有的应用程序角色返回所需的值 - 这隐含地反映了用户的组成员身份。

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

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