【问题标题】:Pre-create user in B2C and send "Reset Password flow"-email pre-populated在 B2C 中预先创建用户并发送“重置密码流程”-预先填充的电子邮件
【发布时间】: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


    【解决方案1】:

    login_hint 用于登录,文档here。在密码重置策略中不起作用,您可以反馈here

    在此流程中无法直接预填充电子邮件地址。您可以使用custom policies 来定义技术配置文件和用户旅程。试试看这个类似的issue

    【讨论】:

    • 好的,谢谢,我会尝试使用自定义策略
    猜你喜欢
    • 1970-01-01
    • 2014-06-17
    • 1970-01-01
    • 2013-04-28
    • 1970-01-01
    • 2014-03-23
    • 2010-09-06
    • 2015-11-26
    • 1970-01-01
    相关资源
    最近更新 更多