gpt4 book ai didi

c# - 在 Azure AD b2c 中创建新用户错误 : Another object with the same value for property proxyAddresses already exists

转载 作者:行者123 更新时间:2023-12-03 06:57:31 32 4
gpt4 key购买 nike

我有一个程序,可以在我的 Azure AD b2c 中通过 Microsoft graph 创建用户对于普通用户,代码运行并创建 AD b2c 帐户

在 B2C 中,我有管理员用户,它们是租户管理员当我尝试以编程方式为 b2c 用户相同的用户创建帐户时,出现错误

Creating new user in Azure AD b2c error: Another object with the same value for property proxyAddresses already exists

但是当我通过 GUI 执行相同的操作时,我可以使用同一电子邮件添加 2 个帐户。第一个是被邀请为管理员的用户,第二个是B2C普通用户

                            var user = new User
{
AccountEnabled = true,

GivenName = "MJX",
Surname = MJX,
Mail = theEmail,
DisplayName = "Someting",
UserType = "Member",
CreationType = "LocalAccount",
PasswordProfile = new PasswordProfile
{
ForceChangePasswordNextSignIn = true,
Password = GeneratedPassword,
},
PasswordPolicies = "DisablePasswordExpiration",
Identities = new List<ObjectIdentity>
{
new ObjectIdentity()
{
SignInType = "emailAddress",
Issuer = tenantName,
IssuerAssignedId = theEmail
}
}
};

//insert into AD
var createdUser = graphServiceClient.Users
.Request()
.AddAsync(user).GetAwaiter().GetResult();

最佳答案

删除了对我有用的 Mail 属性

 //Mail = theEmail

关于c# - 在 Azure AD b2c 中创建新用户错误 : Another object with the same value for property proxyAddresses already exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72778583/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com