I'm trying to implement an LTI Launch Request (http://www.imsglobal.org/LTI/v1p1/ltiIMGv1p1.html) using Scala and Play 2.2.0. It is basically a HTTP POST with form parameters and an OAuth signature.
I can successfully sign the POST but only if the POST body is not added. The 'OAuthCalculator' class doesn't seem to use the POST body when calculating the signature.
This doesn't calculate the correct signature.
val params = Map(
"lti_message_type" -> Seq("basic-lti-launch-request"),
"lti_version" -> Seq("LTI-1p0"),
"launch_presentation_return_url" -> Seq("http://lms.com"),
"resource_link_id" -> Seq("1023"))
WS.url("http://myservice:56024/widget")
.sign(OAuthCalculator(key, RequestToken(null, null)))
.post(params)
It does correctly calculate them if no body is given to the POST.
WS.url("http://myservice:56024/widget")
.sign(OAuthCalculator(key, RequestToken(null, null)))
.post("")
I am purposefully passing an empty request token because I want the calculator to perform OAuth signing only.
Is there another method of adding the POST body or another way to get the library to sign the request?