我试图将一个SAML Response
发布到有效的网址(MVC)。我可以点击URL,但系统无法读取SAML Response
。以下是可以帮助您帮助我的一段代码。
SAML回复
使用以下代码发布此SAML响应。
protected void Button1_Click(object sender, EventArgs e)
{
HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create("LOGIN SSO URL HERE");
XElement obj = XElement.Load(@"SAMLResponse.xml");
StringBuilder postData = new StringBuilder();
postData = postData.Append(obj.ToString());
byte[] data = Encoding.UTF8.GetBytes(postData.ToString());
httpWReq.Method = "POST";
httpWReq.ContentType = "text/xml;encoding='utf-8'";
httpWReq.ContentLength = data.Length;
using (Stream stream = httpWReq.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
....
}
以下是我在MVC中获得的Response对象。
最后我收到错误
无法找到SAMLResponse