【发布时间】: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