public void RstrHelper_CanRoundtripWsTrustvOldRstr() { // Old WSTrust roundtrips to the same canonical Xml, WSTrust 1.3 results in modification of SecurityTokenReference, so we compare those via GenericXmlSecurityToken var rstrHelper = new RstrHelper(); RequestSecurityTokenResponse rstr = rstrHelper.DeserializeRstrFromRstrString(WSTrustvOldRstr); string rstrString = rstrHelper.SerializeToRstrString(rstr, RstrHelper.WsTrustvOldVersion); Assert.That(WSTrustvOldRstr, new XmlSpecificationEqualityConstraint(rstrString)); }
public void RstrHelper_CanRoundtripWsTrust13ActAsRstrViaGenericXmlSecurityTokens() { var rstrHelper = new RstrHelper(); RequestSecurityTokenResponse rstr = rstrHelper.DeserializeRstrFromRstrString(WSTrust13RstrWithActAsToken); string rstrString = rstrHelper.SerializeToRstrString(rstr); var token = rstrHelper.DeserializeTokenFromRstrString(WSTrust13RstrWithActAsToken); var roundTrippedtoken = rstrHelper.DeserializeTokenFromRstrString(rstrString); Assert.AreEqual(token.Id, roundTrippedtoken.Id); }
public void DeserializeTokenFromRstrString_WsTrustvOldRstr_CanParsetoken() { var rstrHelper = new RstrHelper(); var token = rstrHelper.DeserializeTokenFromRstrString(WSTrustvOldRstr); Assert.IsInstanceOf <GenericXmlSecurityToken>(token); Assert.IsNotNull(token); Console.WriteLine(token.Id); }