如何使用C#中的itfoxtec-identity-saml2将此示例添加到断言中?找不到合适的方法...
<saml:AttributeStatement>
<saml:Attribute FriendlyName="SurName" Name="urn:oid:2.5.4.4" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml:AttributeValue xsi:type="xs:string">Max</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute FriendlyName="CommonName" Name="urn:oid:2.5.4.3" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml:AttributeValue xsi:type="xs:string">Max Mustermann</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="urn:oid:0.9.2342.19200300.100.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml:AttributeValue xsi:type="xs:string">has</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute FriendlyName="Email" Name="urn:oid:0.9.2342.19200300.100.1.3" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml:AttributeValue xsi:type="xs:string">max@mustermann.de</saml:AttributeValue>
</saml:Attribute> </saml:AttributeStatement>发布于 2021-08-18 12:46:15
可以将更多声明/属性添加到示例IdP中发出的断言中。
您可以添加所需的声明/属性,该声明/属性随后将在AuthnResponse断言中发出。
发布于 2021-08-18 13:34:00
声明仅限于在System.Security.Claims命名空间中定义的声明类型:

在ComponentsPro中,Saml实现属性是这样添加的:
AttributeStatement attributeStatement = new AttributeStatement();
attributeStatement.Attributes.Add(new ComponentPro.Saml2.Attribute("email", SamlAttributeNameFormat.Basic, null,
"john@test.com"));
attributeStatement.Attributes.Add(new ComponentPro.Saml2.Attribute("FirstName", SamlAttributeNameFormat.Basic, null,
"John"));
attributeStatement.Attributes.Add(new ComponentPro.Saml2.Attribute("LastName", SamlAttributeNameFormat.Basic, null,
"Smith"));
// Insert a custom token key to the SAML response.
attributeStatement.Attributes.Add(new ComponentPro.Saml2.Attribute("CustomTokenForVerification", SamlAttributeNameFormat.Basic, null,
"YourEncryptedTokenHere"));
samlAssertion.Statements.Add(attributeStatement);在Pingfederates Service Provider connections中,需要定义一些自定义属性。这看起来不是一个索赔吗?

https://stackoverflow.com/questions/68830123
复制相似问题