Conditions ノードに AudienceRestriction を含む SamlAssertion を作成する例の方向性を教えてください。
以下は、配置したいコードの例です。
//Create the SAML Assertion
SamlAssertion samlAssert = new SamlAssertion();
samlAssert.AssertionId = Convert.ToBase64String(encoding.GetBytes(System.Guid.NewGuid().ToString()));
samlAssert.Issuer = "http://www.example.com/";
// Set up the conditions of the assertion - Not Before and Not After
samlAssert.Conditions = new SamlConditions(DateTime.Now, DateTime.Now.AddMinutes(5));
目的の XML は次のようになります。
<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" AssertionID="_e835eca079133299b2f8a2a63ad72fe8" IssueInstant="2007-02-07T20:22:58.165Z" Issuer="http://www.example.com/" MajorVersion="1" MinorVersion="1">
<Conditions NotBefore="2007-02-07T20:22:58.162Z" NotOnOrAfter="2007-02-07T20:24:58.162Z">
<AudienceRestrictionCondition>
<Audience>http://www.example2.com</Audience>
</AudienceRestrictionCondition>
</Conditions>
3 番目のパラメーターである条件を許可するSamlConditionsクラスのコンストラクターがあり、 SamlAudienceRestriction クラスがあることがわかりますが、2 つを接続する方法がわかりません。少しコードを見れば、それは痛々しいほど明白になると思いますが、残念ながら、私の google-foo は今日私を失敗させています.