【问题标题】:Azure AD OAuth Token Claim - Populate DisplayName attribute for Application UsersAzure AD OAuth 令牌声明 - 为应用程序用户填充 DisplayName 属性
【发布时间】:2021-04-30 10:20:39
【问题描述】:

当我从 Azure AD 为针对正确资源受众(目标应用程序)的应用程序用户(使用 client_id 和 client_secret)请求 OAuth 令牌时,我不知道如何让 Azure AD 填充客户端的声明Azure AD 中的 DisplayName 属性(主要用于应用程序客户端,但用户也应该使用)。

POST /<tenant_id>/oauth2/token HTTP/1.1
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=<client_id>&resource=<target_aud_app_uri>&client_secret=<client_secret>
{
  "typ": "JWT",
  "alg": "RS256",
  "x5t": "xxx",
  "kid": "xxx"
}.{
  "aud": "<target_aud_app_uri>",
  "iss": "https://sts.windows.net/<tenant_id>/",
  "iat": 1619676176,
  "nbf": 1619676176,
  "exp": 1619680076,
  "aio": "xxx",
  "appid": "<client_id>",
  "appidacr": "1",
  "idp": "https://sts.windows.net/<tenant_id>/",
  "idtyp": "app",
  "oid": "xxx",
  "rh": "xxx",
  "roles": [
    "XXX"
  ],
  "sid": "xxx",
  "sub": "xxx",
  "tenant_ctry": "AU",
  "tenant_region_scope": "OC",
  "tid": "xxx",
  "uti": "xxx",
  "ver": "1.0"
}.[Signature]

在 Azure AD 的目标应用程序配置中,我添加了它在 UI 中允许的所有可选声明,甚至尝试通过清单添加“display_name”,但它不知道如何选择它。有没有办法做到这一点?

【问题讨论】:

  • 这在Microosft.graph命名空间下是可能的,但不能用于任何自定义应用程序。
  • 如果我的回答对你有帮助,可以accept结束话题,谢谢!

标签: oauth-2.0 azure-active-directory azure-application-settings


【解决方案1】:

这个question之前有人问过。

这在Microosft.graph 命名空间下是可能的,但不能用于任何自定义应用程序。换句话说,只有 ms graph api 令牌有 app_displayname 声明。对于应用自定义api的token,目前无法添加app_displayname声明,至少目前是不可能的。

我建议你提交user voice,我会投赞成票。

【讨论】:

猜你喜欢
  • 2021-09-12
  • 2023-01-11
  • 2020-01-16
  • 1970-01-01
  • 1970-01-01
  • 2020-02-13
  • 2018-12-31
  • 2022-10-07
  • 2021-03-03
相关资源
最近更新 更多