Skip to Content.
Sympa Menu

mace-opensaml-users - Re: java-opensaml2 JUnit failure - org.opensaml.saml1.binding.encoding.HTTPPostEncoderTest

Subject: OpenSAML user discussion

List archive

Re: java-opensaml2 JUnit failure - org.opensaml.saml1.binding.encoding.HTTPPostEncoderTest


Chronological Thread 
  • From: Brent Putman <>
  • To:
  • Subject: Re: java-opensaml2 JUnit failure - org.opensaml.saml1.binding.encoding.HTTPPostEncoderTest
  • Date: Fri, 08 Feb 2008 23:34:10 -0500

The HTTP POST encoders are used to send a message from one SAML system entity to another indirectly via an HTML form set back to the browser.  It's one of the so-called front-channels for SAML SSO usage.  See the SAML 1 and 2 Bindings document.

As someone else already pointed out, "test/html" is probably the best lowest-common-denominator choice, due to browser issues.

I don't know if there is a way to dynamically determine from the Velocity template - looks doubtful - but the POST binding pretty much dictates that it will be an HTML form, so the template has to conform to that requirement.  The binding requirement and code determines it, not the template, it can't be any arbitrary MIME type.

This is now fixed on the trunk also.



Clifford Johnson wrote:

The only test case in this class fails with the following details:

 

org.opensaml.saml1.binding.encoding.HTTPPostEncoderTest#testEncoding

 

junit.framework.ComparisonFailure: Unexpected content type expected:<application/xhtml+x...> but was:<text/ht...>

    at org.opensaml.saml1.binding.encoding.HTTPPostEncoderTest.testEncoding(HTTPPostEncoderTest.java:81)

 

The test case is expecting the Content-Type to be “application/xhtml+xml” but org.opensaml.saml1.binding.encoding.HTTPPostEncoder#postEncode sets the Content-Type to a constant “text/html” which doesn’t seem quite right – I don’t know the circumstances under which [saml1] HTTPPostEncoder is used but I’d think the Content-Type value should probably be obtained from the Velocity template in some way since it’s the template content that would govern the proper value.  In the test case, the template seems to be an XHTML document.

 

Is a hard-coded value in HTTPPostEncoder appropriate?  Since the class is Velocity template driven, is there some way to derive the proper type from the template (or resulting document)?

 

Clifford



  • Re: java-opensaml2 JUnit failure - org.opensaml.saml1.binding.encoding.HTTPPostEncoderTest, Brent Putman, 02/08/2008

Archive powered by MHonArc 2.6.16.

Top of Page