【问题标题】:Claims not showing after applying new Azure AD Policy应用新的 Azure AD 策略后未显示声明
【发布时间】:2019-06-03 09:31:03
【问题描述】:

我想为我的 Azure AD (ADAL) 连接的 C# Web 应用程序添加其他声明。

  1. 我已尝试在 PowerShell 中添加新策略(根据 https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-claims-mapping#claims-mapping-policy-assignment)并重新运行应用程序。相同的声明显示(不多也不少)。

  2. 有没有办法添加经理字段。我没有在这个列表中看到它 (https://docs.microsoft.com/mt-mt/azure/active-directory/develop/active-directory-claims-mapping?view=azurermps-6.9.0)

以下是我尝试过的 PowerShell Cmdlet:

New-AzureADPolicy -Definition @('{"ClaimsMappingPolicy":{"Version":1,"IncludeBasicClaimSet":"true", "ClaimsSchema": [{"Source":"user","ID":"department","JwtClaimType":"role"},{"Source":"user","ID":"extensionattribute1","JwtClaimType":"userdata"}]}}') -DisplayName "CustomClaimsPolicy" -Type "ClaimsMappingPolicy"

Add-AzureADServicePrincipalPolicy -Id { Principal Object Id } -RefObjectId { Policy Id }

在 C# 中,我将声明如下:

var claims = User.Claims.Select(claim => new { claim.Type, claim.Value }).ToArray();

【问题讨论】:

    标签: c# azure powershell azure-active-directory


    【解决方案1】:

    我可以在我这边重现您的问题,powershell 工作正常,但我检查了门户中的user attributes,它们不存在。好像是bug(不确定,如果我做错了,请纠正我),你可以在Github中open an issue,记住这个功能是在预览中。

    有没有办法添加经理字段。我没有在这个列表中看到它

    您似乎无法做到这一点,请参阅这个已知问题:Email address not being passed and Manager ID not available to be mapped

    【讨论】:

    • 正如我所怀疑的那样。谢谢。
    猜你喜欢
    • 2018-07-09
    • 2018-03-28
    • 2018-12-07
    • 2019-11-14
    • 1970-01-01
    • 2021-10-24
    • 1970-01-01
    • 2022-11-02
    • 2020-12-23
    相关资源
    最近更新 更多