Im пытается создать билет SAML2 с помощью OIOSAML.net.Тип определения атрибута/атрибута OIOSAML/SAML2?
У меня получилось 95% от правильной структуры, однако при создании xml у меня есть следующая проблема.
Результат:
<saml2:Attribute name="urn:x:names:federation:attributeName:systemversion" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue>1.0</saml2:AttributeValue>
</saml2:Attribute>
Ожидаемое:
<saml2:Attribute Name="urn:x:names:federation:attributeName:systemversion" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">1.0</saml2:AttributeValue>
</saml2:Attribute>
Я отсутствует определение типа на моем AttributeValue. Из определения объекта я могу зачитать следующее.
/// <summary>
/// Gets or sets the attribute value.
/// Contains a value of the attribute. If an attribute contains more than one discrete value, it is
/// RECOMMENDED that each value appear in its own <AttributeValue> element. If more than
/// one <AttributeValue> element is supplied for an attribute, and any of the elements have a
/// datatype assigned through xsi:type, then all of the <AttributeValue> elements must have
/// the identical datatype assigned.
/// </summary>
/// <value>The attribute value.</value>
[XmlElement("AttributeValue", IsNullable = true)]
public string[] AttributeValue
{
get { return attributeValueField; }
set { attributeValueField = value; }
}
И им определение атрибута следующим образом:
var attr = new SamlAttribute() {
Name = StringConstants.SAML2_ATTRIBUTE_PREFIX + StringConstants.ATTRIBUTE_INFO_SYSTEMVERSION,
AttributeValue = new[] {this.SystemVersion},
NameFormat = StringConstants.ATTRIBUTE_FORMAT
};
Вопрос Как я могу получить мой <AttributeValue>
определить xsi:type="xs:string"
?