当我从 Azure AD 为针对正确资源受众(目标应用程序)的应用程序用户(使用 client_id 和 client_secret)请求 OAuth 令牌时,我不知道如何让 Azure AD 填充客户端DisplayName属性的声明(主要用于应用程序客户端,但用户也应该在 Azure AD 中工作。
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”,但它不知道如何选择它。有没有办法做到这一点?