Skip to Content.
Sympa Menu

mace-opensaml-users - [OpenSAML] Unable to Decode message encoded by HTTPRedirectDeflateEncoder

Subject: OpenSAML user discussion

List archive

[OpenSAML] Unable to Decode message encoded by HTTPRedirectDeflateEncoder


Chronological Thread 
  • From: John Gonzales <>
  • To:
  • Subject: [OpenSAML] Unable to Decode message encoded by HTTPRedirectDeflateEncoder
  • Date: Sat, 5 Feb 2011 11:25:32 -0500 (EST)

Hi there,

I am sending an encoded message across the wire to a Rails application I am
developing. When I try decode this message, I get the an error of
"Zlib::DataError incorrect header check". I have tried many different things
not the Rails-end of this equation, but I'm wondering if there might be
something wrong on the OpenSAML-end via the Java OpenSAML Library.

Here is my Java code that encodes the message:

HttpServletResponseAdapter responseAdapter = new
HttpServletResponseAdapter(response, false);

responseAdapter.setStatusCode(HttpServletResponse.SC_MOVED_TEMPORARILY);

SingleSignOnService ssoService = new
SingleSignOnServiceBuilder().buildObject();
ssoService.setLocation(identityProviderSSOServiceURL);

AuthnRequest authnRequest = Saml2Util.createAuthnRequest();
BasicSAMLMessageContext messageContext = new
BasicSAMLMessageContext();
messageContext.setOutboundMessage(authnRequest);
messageContext.setOutboundSAMLMessage(authnRequest);
messageContext.setOutboundMessageTransport(responseAdapter);
messageContext.setPeerEntityEndpoint(ssoService);

HTTPRedirectDeflateEncoder encoder = new
HTTPRedirectDeflateEncoder();
encoder.encode(messageContext);

On the Rails-end, all GET parameters are automatically URL-decoded. So all I
need to do is Base64 Decode, then INFLATE. Here is my code that does this
latter piece:

Zlib::Inflate.inflate(Base64.decode64(message)

message is the URL-decoded SAMLRequest GET parameter.

Fairly simple, but then again, I'm not sure if I implemented the Java-end
correctly. In any case, when my Ruby/Rails code executes, I get the error I
mentioned above. For good measure, here it is once again:

Zlib::DataError (incorrect header check):
mylib/codecs.rb:19:in `inflate'

As the stack trace reports, the error is happening while trying to inflate the
message. I've searched and tried many alternatives to get this message to
decode on the Rails-end, but nothing has worked so far. My searches are
suggesting that perhaps the message itself is corrupt, which is why I'm taking
a look at the Java-end.

I've been scratching my head for the two-hours on the Rails-end, and the past
hour on the Java-end. Needless to say, any help would be greatly appreciated!

Thanks in advance!



Archive powered by MHonArc 2.6.16.

Top of Page