I am trying to implement ITfoxtec SAML 2.0 in an ASP.NET Web Forms (ASPX) application.
The usual ASP.NET MVC implementation uses the statement:
binding.ReadSamlResponse(Request.ToGenericHttpRequest(), saml2AuthnResponse);
but the MVC Request is not available in Web Forms.
In VB I have tried code such as
Dim request As New ITfoxtec.Identity.Saml2.Http.HttpRequest
request.Method = "GET"
request.Query = HttpContext.Current.Request.Form
binding.ReadSamlResponse(request, saml2AuthnResponse)
but this raises the exception:
Found invalid data while decoding.
at System.IO.Compression.InflaterZlib.Inflate(FlushCode flushCode)
at System.IO.Compression.InflaterZlib.ReadInflateOutput(Byte[] outputBuffer, Int32 offset, Int32 length, FlushCode flushCode, Int32& bytesRead)
at System.IO.Compression.InflaterZlib.Inflate(Byte[] bytes, Int32 offset, Int32 length)
at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count)
at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)
at System.IO.Stream.CopyTo(Stream destination)
at ITfoxtec.Identity.Saml2.Saml2RedirectBinding.DecompressResponse(String value)
at ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read(HttpRequest request, Saml2Request saml2RequestResponse, String messageName, Boolean validateXmlSignature, Boolean detectReplayedTokens)
at ITfoxtec.Identity.Saml2.Saml2Binding`1.ReadSamlResponse(HttpRequest request, Saml2Response saml2Response)
at [my code]
How can I convert HttpContext.Current.Request to ITfoxtec.Identity.Saml2.Http.HttpRequest?
Hoping for assistance,
David.