代码之家  ›  专栏  ›  技术社区  ›  One Developer

Key斗篷:将Azure AD的电子邮件映射到自动创建的Key斗篷用户

  •  0
  • One Developer  · 技术社区  · 2 年前

    我已将Microsoft Active Directory添加为标识提供程序,如下所示

    enter image description here

    并配置验证流以自动创建用户

    enter image description here

    映射器配置为根据声明将用户映射到角色

    enter image description here

    在此部分之前一切正常,用户将自动创建/添加

    enter image description here

    但是,“电子邮件”列为空。

    我想自动填充 电子邮件 ,因此在Azure AD中添加了所需的声明,如下所示

    enter image description here

    我在ID JWToken中看到了可选添加的声明(即preferred_username&upn)

    enter image description here

    我尝试将声明映射到用户配置文件/属性,如下所示

    enter image description here

    然而 “电子邮件” 列未被填充或更新任何其他属性

    enter image description here

    我应该怎么做才能自动创建用户并填充他/她的电子邮件?

    0 回复  |  直到 2 年前
        1
  •  3
  •   Vitaly    2 年前

    这个 preferred_username 索赔是 profile scope,您的IDP配置中的作用域列表中有它吗? 例如。 Scopes list

    此外,您可以使用标准范围 email ,然后索赔 电子邮件 将在Keycloack中提供。