public void Resolve(IdpSsoService artifactResolutionService, Saml2AuthnResponse authnResponse) { var xmlDoc = this.ToXml(); var soapEnvelope = new SOAPEnvelope(); soapEnvelope.Body = xmlDoc; xmlDoc = soapEnvelope.ToSoapXml(); WebClient client = new WebClient(); client.Encoding = Encoding.UTF8; client.Headers.Add(HttpRequestHeader.ContentType, "text/xml; charset=\"utf-8\""); client.Headers.Add(HttpRequestHeader.Accept, "text/xml"); var result = client.UploadString(artifactResolutionService.Location, xmlDoc.OuterXml); soapEnvelope.FromSoapXml(result); var ares = new SamlArtifactResponse(authnResponse) { SignatureValidationCertificate = SignatureValidationCertificate }; ares.Read(soapEnvelope.Body.OuterXml, SignatureValidationCertificate != null); }
public void Resolve(IdpSsoService artifactResolutionService, Saml2AuthnResponse authnResponse) { var xmlDoc = this.ToXml(); var soapEnvelope = new SOAPEnvelope(); soapEnvelope.Body = xmlDoc; xmlDoc = soapEnvelope.ToSoapXml(); WebClient client = new WebClient(); client.Encoding = Encoding.UTF8; client.Headers.Add(HttpRequestHeader.ContentType, "text/xml; charset=\"utf-8\""); client.Headers.Add(HttpRequestHeader.Accept, "text/xml"); var result = client.UploadString(artifactResolutionService.Location, xmlDoc.OuterXml); soapEnvelope.FromSoapXml(result); var ares = new SamlArtifactResponse(authnResponse) { SignatureValidationCertificate = SignatureValidationCertificate }; ares.Read(soapEnvelope.Body.OuterXml, SignatureValidationCertificate != null); }