在 Azure AD B2C 中使用 Microsoft.Graph SDK 创建本地帐户

Create local account using Microsoft.Graph SDK in Azure AD B2C

是否可以使用 Microsoft.Graph SDK 将本地帐户添加到 Azure AD B2C?

Microsoft Graph API 文档要求发送 this data(不同于 work/school 帐户的成员)。

我试过这个:

User createdUser = graphClient.Users.Request().AddAsync(new User
{
    AccountEnabled = true,
    DisplayName = "TestUser",
    PasswordProfile = new PasswordProfile
    {
        ForceChangePasswordNextSignIn = false,
        Password = "Abcd@1234"
    },
    UserPrincipalName = "testuser@test.com",
    MailNickname = "testuser@test.com",
}).Result;

但这只是 returns ServiceException: Code: InternalServerError Message: The given key was not present in the dictionary.

的一个例外

Microsoft.Azure.ActiveDirectory.GraphClient 但这没有被弃用吗?很多 "old" 样本提到:"It is recommended for new projects to use Microsoft.Graph SDK",或者类似的词,在它们的顶部。

目前..你不能。

here and here