azure-active-directory - 无法通过 Azure B2C 中的图形 API 创建本地帐户

标签 azure-active-directory azure-ad-b2c

我正在尝试通过 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/

相关文章:

azure - 如何通过Graph API重置Azure AD B2C中的用户密码?

c# - 如何为 Azure AD B2C 用户将 TokenValidationParameters.NameClaimType 设置为 "username"而不是 "name"?

azure-ad-b2c - 控制 GitHub 请求权限

python - 如何使用 python 从 azure 获取特定资源组的成本详细信息?

powershell - Azure Active Directory 中可配置的 token 生命周期

Azure Active Directory - 基于角色的存储管理器

amazon-web-services - azure 中是否可以进行跨租户 blob 访问?

azure - AAD B2C IEF : How to pass error code and message from REST API to the application with costom policy?

azure-ad-b2c - 混合大小写 IssuerAssignedId 的 Graph B2C 过滤查询

azure - 用于登录 Azure AD 的 SSO : Using outlook. com 帐户