在Azure AD B2C中创建新用户错误:已存在具有相同值相同值的另一个对象已经存在
我有一个程序,通过我的Azure AD B2C中的Microsoft Graph创建用户 对于普通用户,代码
在B2C中运行并创建AD 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();
I have a program which I create users through Microsoft graph in my Azure AD b2c
for normal users the code runs and creates AD b2c account
In the B2C I have admin users which are the Tenant administrators
When I try to create programatically accounts for the same user as b2c user I get error
Creating new user in Azure AD b2c error: Another object with the same value for property proxyAddresses already exists
but when I perform the same operation through GUI I can add 2 accounts with the same email.
the first is the user which is invited as admin and the second is the B2C normal user
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();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
删除了它为我工作的邮件属性
Removed the Mail property it worked for me