Hi,
I'm trying to develop an LTI app and I have almost everything set up to publish with an external tool, but when I call to content item return url Moodle returns an error saying "Exception - OAuth signature failed: Invalid signature ours= LeDuZRIV2w/OZ+HRPkUBQ+1n0qE= yours=xwXtczMGJxBG4I3uwxFgFxgHXb4=". I'm using the following content item definition
$contentItem = [ '@context' => 'http://purl.imsglobal.org/ctx/lti/v1/ContentItem', '@graph' => [ [ '@type' => 'LtiLinkItem', 'url' => $link, 'title' => $title, 'text' => $instructions ?? '', 'mediaType' => 'application/vnd.ims.lti.v1.ltilink', 'placementAdvice' => ['presentationDocumentTarget' => 'frame'], 'thumbnail' => [ '@id' => $thumbnail, 'width' => 500, 'height' => 707 ], ], ], ];
And I'm signing it using the content item return url sent by Moodle at the launch, a new timestamp and nonce and the consumer secret. The method of signing is working (as far as I know) because the signature validation works on the launch request, so it must be something with the parameters, but I don't know what's going on. The parameters I send are
[ 'oauth_consumer_key' => $consumerKey, 'oauth_nonce' => $newNonce, 'oauth_signature_method' => 'HHMAC-SHA1', 'oauth_timestamp' => (new DateTime('now', new DateTimeZone('UTC')))->getTimestamp(), 'oauth_version' => '1.0', 'content_items' => json_encode($contentItem), 'lti_message_type' => 'ContentItemSelection', 'lti_version' => 'LTI-1p0', ],
Maybe someone has already done this and can shed some light on what's going on.
Thanks a lot