简体   繁体   English

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

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

Is it possible to add local account to Azure AD B2C using the Microsoft.Graph SDK? 是否可以使用Microsoft.Graph SDK将本地帐户添加到Azure AD B2C?

The Microsoft Graph API documentation requires that this data is sent (distinct members from that of work/school account). Microsoft Graph API文档要求发送此数据 (与工作/学校帐户的成员不同)。

I tried this: 我尝试了这个:

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;

But it just returns an exception of ServiceException: Code: InternalServerError Message: The given key was not present in the dictionary. 但是它只返回ServiceException: Code: InternalServerError Message: The given key was not present in the dictionary.的异常ServiceException: Code: InternalServerError Message: The given key was not present in the dictionary.

There is Microsoft.Azure.ActiveDirectory.GraphClient but is this not being deprecated? Microsoft.Azure.ActiveDirectory.GraphClient但是是否不建议使用? A lot of the "old" samples mention: "It is recommended for new projects to use Microsoft.Graph SDK" , or words to that effect, at the top of them. 许多“旧的”示例都提到: “建议新项目使用Microsoft.Graph SDK” ,或在其顶部使用类似的词语。

Currently.. You can't. 目前..您不能。

See here and here 这里这里

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

相关问题 Microsoft Graph SDK 未返回 Azure AD B2C 用户的自定义属性值 - Microsoft Graph SDK not returning Custom attributes values of Azure AD B2C Users 使用 Microsoft Graph + Http 客户端更改 Azure AD B2C 上的用户密码 - Change user password on Azure AD B2C using Microsoft Graph + Http Client 如何在不使用Microsoft页面的情况下在Azure AD B2C中使用graph api进行社交登录? - How to use graph api for social login in Azure AD B2C without using Microsoft page? 带有 B2C AD 的 Azure Graph - Azure Graph with B2C AD 如何在Azure AD B2C中配置Microsoft帐户身份提供程序以重定向到我的URL - How can I configure Microsoft Account identity provider in Azure AD B2C to redirect to my URL 如何以编程方式通过 Microsoft Graph 获取 Azure AD b2c 登录日志 - how to get Azure AD b2c sign-in logs through Microsoft Graph programatically Microsoft graph 更改 azure ad b2c 用户密码不起作用 - Microsoft graph change azure ad b2c user password not working 如何使用C#Microsoft.Graph创建回复? - How to create a reply using C# Microsoft.Graph? 如何使用 MSAL C#、.net 核心在 Azure AD B2C 用户帐户上重置密码? - How to reset password on Azure AD B2C user account using MSAL C#, .net core? 使用Graph API在Azure AD B2C中创建具有自定义属性的用户 - Create user with Custom Attributes in Azure AD B2C with Graph API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM