我不知道如何在 eg 中获得主要主题颜色(Angular Material)component.ts。
我可以color="primary在 mytemplate.html或mat-color($primary)a 中使用style.scss。但是如何使用主题颜色为画布内的元素设置样式?我如何在我的 TypeScript 代码中使用它们?
信息:
"@angular/material": "^5.0.0-rc.2",
"@angular/core": "^5.0.0"
Run Code Online (Sandbox Code Playgroud) typescript angular-ui angular-material angular-material2 angular
在我的场景中,有一个带有凭据的 Azure 应用程序注册 ( client_app )。该应用程序用于请求 oauth2 访问令牌。第二个应用程序注册(main_app)是范围,它提供应用程序角色等。
我的目标是在 azure 端点上使用客户端凭据流请求令牌时,将来自client_app的信息包含在 jwt 令牌声明中。/oauth2/v2.0/token
这是一个令牌请求:
POST /<tenant id>/oauth2/v2.0/token HTTP/1.1
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id=<Application ID of client_app>
&client_secret=<secret of client_app>
&scope=<Application ID URI of main_app + "/.default">
&grant_type=client_credentials
Run Code Online (Sandbox Code Playgroud)
令牌请求的响应是一个有效的令牌,包括(从main_app到client_approles授予的应用程序角色)、和声明。但我的可选声明丢失了。audsubidtype: app
MS 文档指出,可以使用目录扩展包含可选声明
可选声明不支持架构和开放扩展,仅支持 AAD-Graph 样式目录扩展。此功能对于附加您的应用程序可以使用的其他用户信息非常有用 [...]
因此,我尝试向main_app ( )添加目录扩展,向main_appextension_<main_app ID>_someAttrName添加可选声明,并将值存储到client_app中的该目录扩展中。不幸的是,扩展值没有反映在令牌中。
我尝试在client_app本身 ( )上添加目录扩展,并使用ClaimsMappingPolicyextension_<client_app ID>_someAttrName将目录扩展映射到 …