的價值我曾嘗試多種方法來解析SAMLC#SAML解析到XML得到觀衆
string raw = txt.Text;
if (raw.Contains('%'))
{
raw = HttpUtility.UrlDecode(raw);
}
byte[] xmlMessageBytes = Convert.FromBase64String(raw);
XmlDocument document = new XmlDocument { PreserveWhitespace = true };
document.LoadXml(Encoding.UTF8.GetString(xmlMessageBytes));
但我得到的響應隨機字符。但是當我使用Firefox插件SAMLTracer時,它工作得很好。
任何幫助,非常感謝。
除非這樣做爲了好玩/學習,我建議你不要創建自己的SAML2執行。這是很多工作,很容易使關鍵的安全機制出錯(XML簽名包裝漏洞在SAML實現中很常見)。 –