【问题标题】:Get Friendly Name of claims from Identity从身份中获取声明的友好名称
【发布时间】:2016-12-26 17:17:15
【问题描述】:

我收到索赔 输入身份,如this

我只想将友好名称“AdLogon”作为我的声明类型。 我知道我们可以通过操作字符串来做到这一点,但是有什么标准方法可以做到这一点。

【问题讨论】:

    标签: asp.net asp.net-identity wif claims-based-identity asp.net-identity-2


    【解决方案1】:

    正常的声明规则是这样的形式,例如:

    c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"), query = ";mail;{0}", param = c.Value);

    你想要类似的东西:

    c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/AdLogon"), query = ";[some attribute];{0}", param = c.Value);

    要获得“AdLogon”,请使用:

    c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("AdLogon"), query = ";[some attribute];{0}", param = c.Value);

    【讨论】:

    • 我正在使用 WIF 从联合服务器对其进行身份验证,因此它会自动填充声明 Type=[link]schemas.xmlsoap.org/ws/2005/05/identity/claims/AdLogon 格式,但我只想要 Type ="AdLogon"。
    • 我说的是 ADFS 中的声明规则 - 还是您在使用其他东西?
    猜你喜欢
    • 2016-04-29
    • 2017-10-23
    • 1970-01-01
    • 1970-01-01
    • 2021-12-14
    • 2017-05-05
    • 2011-11-24
    • 2017-06-19
    • 1970-01-01
    相关资源
    最近更新 更多