【发布时间】:2021-06-01 11:39:56
【问题描述】:
我正在使用 Graph Api 在 B2C 中预先创建用户,然后发送带有“重置密码”的电子邮件 - 用户流 URL 为:
https://xxx.b2clogin.com/xxx.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1_ResetPassword&client_id=xxx&nonce=defaultNonce&redirect_uri=https%3A%2F%2Fjwt.ms&scope=openid&response_type=code&prompt=login&code_challenge=xxx&login_hint=me@example.com
有没有办法预先填充电子邮件地址字段,这样用户就不需要手动编写它了?我试过附加login_hint,但它不起作用。
创建用户代码:
`var user = new User
{
DisplayName = displayName,
AccountEnabled = true,
UserType = "Member",
Identities = new List<ObjectIdentity>()
{
new ObjectIdentity
{
SignInType = "emailAddress",
Issuer = "xxx",
IssuerAssignedId = email
},
},
PasswordProfile = new PasswordProfile
{
Password = password,
ForceChangePasswordNextSignIn = false
},
PasswordPolicies = "DisablePasswordExpiration",
AdditionalData = customAttributes
};
await graphClient.Users
.Request()
.AddAsync(user);`
【问题讨论】:
标签: azure-ad-b2c azure-ad-graph-api