【发布时间】:2020-09-24 10:32:45
【问题描述】:
我正在使用带有 SignInType 作为用户名的 GraphServiceClient 创建新用户,如下所示:
var user = new User
{
AccountEnabled = true,
GivenName = "Joe",
Surname = "Bob",
DisplayName = "Name",
Mail = "joe@bob.com",
MobilePhone = "111111111",
Identities = new List<ObjectIdentity>()
{
new ObjectIdentity
{
SignInType = "userName",
Issuer = "<Issuer...>",
IssuerAssignedId = "someName"
},
},
PasswordProfile = new PasswordProfile
{
ForceChangePasswordNextSignIn = false,
Password = "<pass>"
},
PasswordPolicies = "DisablePasswordExpiration,DisableStrongPassword",
};
await gsc.Users.Request().AddAsync(user);
在 Azure 中创建该用户后,我可以使用此帐户登录使用 B2C 登录策略的应用程序。但是,当我想为该用户调用 ResetPassword 策略时,在成功通过电子邮件验证后,我收到错误消息:“找不到提供的用户 ID 的帐户。”。经过反复试验,我发现 azure 用户配置文件选项卡“身份验证方法”中缺少数据。当我填写电子邮件输入时,一切正常,用户可以重置密码。
所以我正在寻找一种在创建期间如何将用户电子邮件填充到“身份验证方法”部分的方法。
【问题讨论】:
标签: azure azure-ad-b2c