更新时间:2023-12-02 13:20:16
开箱即用的AAD B2C SignUp-SignIn用户流未公开任何与安全组相关的功能.
Out-of-the-box AAD B2C SignUp-SignIn user flow does not expose any functionality related to Security Groups.
如果要在B2C中使用组声明,请选择通过自定义(IEF)策略添加一些自定义代码.请参阅此答案和
If you want to use group claims in B2C, choose to add some custom code through custom (IEF) policies. See this answer and this post.
In order to achieve your requirements, you could use custom attribute which you have mentioned.
请注意,如果您不希望用户自己设置自定义属性,则无需在"在用户流中使用自定义属性"下的第3步.
Please note that if you don't want the user to set the custom attribute by themselves, you don't need to do this 3rd step under "Use a custom attribute in your user flow":
创建自定义属性后,可以在MS Graph API中使用自定义属性.
After you create the custom attribute, you can Get the application properties and Using custom attribute with MS Graph API.
使用Microsoft Graph更新用户的自定义属性:
Update the custom attribute for a user with Microsoft Graph:
PATCH https://graph.microsoft.com/v1.0/users/userID
{"extension_831374b3bd5041bfaa54263ec9e050fc_ShoeSize": "123"}
然后,您可以像这样获得令牌中的自定义属性声明:"extension_ShoeSize":"123"
.
Then you can get the custom attribute claim in token like this: "extension_ShoeSize": "123"
.