我正在尝试通过 Azure AD Graph API 在 B2C 域中创建“LocalAccount”。
为此,我注册了一个应用程序(通过 Azure Active Directory -> 应用程序注册(旧版))并添加了“Windows Azure Active Directory”的所有权限。
创建用户的请求是
add_user_json = {
"accountEnabled": True,
"creationType": "LocalAccount",
"signInNames": [{
"type": "emailAddress",
"value": "test@email.com"
},
{
"type": "emailAddress",
"value": "test2@email.com"
}],
"displayName": user_id,
"mailNickname": user_id,
"passwordProfile": {
"password": "aPassword",
"forceChangePasswordNextLogin": "true"
},
"passwordPolicies": "DisablePasswordExpiration"
}
和端点“https://graph.windows.net/ {tenant}.onmicrosoft.com/users?api-version=1.6”(我也试过“https://graph.windows.net/myorganization/users?api-version=1.6”)。
我得到的错误是“一个或多个属性包含无效值。”
此外,如果我通过注册流程创建新用户,则可以创建本地帐户。
有人知道我做错了什么吗?
最佳答案
“一个或多个属性包含无效值。”发生错误是因为用户 对象不能有多个相同类型 的signInName 条目。
关于azure-active-directory - 无法通过 Azure B2C 中的图形 API 创建本地帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56275348/