1

我们有一条规则可以向我们的依赖第三方之一发布与以下内容完全匹配的属性(显然我做了一些更改):

<Attribute Name="http://example.com/#Something" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
    <AttributeValue xsi:type="xsd:string">http://example.com</AttributeValue>
</Attribute>

我在声明规则语言中看不到任何可以让我进行上述操作的内容 - 获取Attribute Name部件很容易,获取值AttributeValue很容易,但是添加NameFormat和获取类型AttributeValue似乎并没有出现.

例如,这个:

=> issue(Type = "http://example.com/#Something",
         Value = "http://example.com",
         ValueType = "string");

可以带我们到这里:

<Attribute Name="http://example.com/#Something">
    <AttributeValue a:type="tn:string" xmlns:tn=" http://www.w3.org/2001/XMLSchema" xmlns:a="http://www.w3.org/2001/XMLSchema-instance">http://something.com</AttributeValue>
</Attribute>

我们也尝试http://www.w3.org/2001/XMLSchema#stringValueType相当相似的结果。我没有看到任何可以添加 的内容NameFormat,而且添加的信息肯定AttributeValue比我们需要的要多得多。

有没有办法只发出持续的索赔?这些值没有任何变化;我希望能够将 XML 放在某个地方并将其集成到整个 SAML 消息中。

4

1 回答 1

2

有点晚了,但希望它可以帮助别人。

下面的例子有帮助吗?

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"] 
=> issue( 
Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", 
Issuer = c.Issuer, 
OriginalIssuer = c.OriginalIssuer, 
Value = c.Value, 
ValueType = c.ValueType, 
Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/attributename"] = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"); 

关键部分是使用由 URI http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/attributename标识的 NameFormat 来操作属性。http://blogs.msdn.com/b/card/archive/2010/06/21/a-quick-walkthrough-setting-up-ad-fs-saml-federation-with-a-shibboleth-sp.aspx有有关名称格式的更多详细信息。

您可以跳过条件检查并按如下方式发出声明

=> issue( 
    Type = "http://example.com/#Something", 
    Value = "http://example.com", 
    Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/attributename"] = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"); 
于 2013-06-16T14:04:50.220 回答