Variable 'SAML Response' is missing.

0
Hi, I'm trying to create a SAMLresponse from a request. I'm getting "Variable 'SAML Response' is missing." error message. Here the code i'm using. var collection = HttpContext.Current.Request.QueryString; var headers = HttpContext.Current.Request.Headers; // Get the "IsReadOnly" protected instance property. var propInfo = collection.GetType().GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic); // Mark the collection as NOT "IsReadOnly" propInfo.SetValue(collection, false, new object[] { }); string rawSamlData = WebConfigurationManager.AppSettings["TEMP_SAML_RESPONCE"]; rawSamlData = HttpUtility.UrlDecode(rawSamlData); // read the base64 encoded bytes byte[] samlData = Convert.FromBase64String(rawSamlData); // read back into a UTF string string samlAssertion = Encoding.UTF8.GetString(samlData); collection["SAMLResponse"] = samlAssertion; headers["Content-Type"] = "application/x-www-form-urlencoded"; ComponentPro.Saml2.Response samlResponse = ComponentPro.Saml2.Response.Create(request); // issue is here
 
asked 12/16/2019 9:03:27 AM
add a comment

1 Answers

0
We are not quite sure what this code segment does. What is the version of Ultimate SAML you are using? Since v7.1 it reads SAMLResponse from both Form and Query string. If you are using v7.1 or above and still have that issue, I guess you have a malformed SAML request. You can validate your response using our tool at: [https://www.samlcomponent.net/tools/validate_xml.aspx][1] [1]: https://www.samlcomponent.net/tools/validate_xml.aspx
 
answered 12/21/2019 5:59:27 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged saml or ask your own question.