Azure AD : include custom field in id_token

标签 azure azure-active-directory openid-connect

我正在使用 Azure Active Directory(OpenId-Connect 流)对 ASP.NET MVC Web 应用程序中的用户进行身份验证。我想在 AD 中为我的用户设置一个“结构”字段,并能够将其包含在用户登录时提供的 id_token 中,以便应用程序知道它(在 AD 中自动创建用户需要此字段)应用程序)。

是否可以使用 Azure AD 执行类似的操作?如果没有,是否可以使用现有字段,例如部门(也不包含在 id_token 中)?如果仍然不可能,是否可以使用图形 API 之类的东西来提供此信息? (以及如何从 AD 中设置此字段,并从应用程序中检索它?)

最佳答案

今天(2017-04-19)您无法自定义 ID token 。

但是您当然可以使用 Graph API 获取有关登录用户的所有信息,并基于此对您的 ClaimsPrincipal 进行建模。例如GetUser operation .

您可以阅读有关事件的更多信息here 。您感兴趣的是 AuthenticationValidated

关于Azure AD : include custom field in id_token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43482976/

相关文章:

azure - AAD : How do you send an "interactive authorization request" to resolve AADSTS65001 when using MSAL if it's not by calling acquireTokenPopup?

azure - 如何在命令行上获取用于服务身份验证的 AzureAD JWT

具有 OpenId 身份验证的 ASP.NET : redirect to url if not authorized

rest - 发现 OpenID Connect 提供商发行者

git - 其他 git 存储库的构建管道期间出现 Azure DevOps 错误 'Git fetch failed with exit code 128'

c# - 缺少程序集引用 Microsoft.IdentityModel.Clients.ActiveDirectory

Azure 日志查询显示空值

Azure AD : Unable to issue tokens from this api version

azure - 如何使用 azure CLI 创建 Power BI Embedded 工作区?

azure - 读取 azure blob 时使用服务主体