To post messages, you must join the IMS Public Community (free).   |   You also can also join the Common Cartridge Alliance.
IMS GLC Public Forums and Resources
Decrease font size
Increase font size
Topic Title: Simple test harness broken?
Topic Summary:
Created On: 02/28/2012 04:51 PM
Status: Post and Reply
Linear : Threading : Single : Branch
Topic Tools Topic Tools
View topic in raw text format. Print this topic.
 02/28/2012 04:51 PM
User is offline View Users Profile Print this message

Author Icon
jellisii

Posts: 2
Joined: 02/28/2012

The simple LMS test application at http://www.imsglobal.org/devel.../LTI/test/v1p1/lms.php appears to not handle spaces in the oauth signature properly: It appears to turn the offered key's plus signs ('+') into spaces.

I have a tool that I'm testing with the above and stumbled upon this problem. Digging through what I can see on my side, it's reliably reproducible.

LIS response starts
V1.0 4f4d48d941c9c failure status OAuth signature failed: Invalid signature ours= K0y6d7q8h3tbm4+hWRNq2WbLrPA= yours=K0y6d7q8h3tbm4 hWRNq2WbLrPA= B64key=123451 HDRkey=123451 secret=secret zzz
LIS response ends
header was POST /developers/LTI/test/v1p1/common/tool_consumer_outcome.php?b64=MTIzNDUxOjo6c2VjcmV0 HTTP/1.1 Host: www.imsglobal.org Accept: */* Authorization: OAuth oauth_body_hash="dEiFhO4qVoJRsw9ddKUmnMQJ6Ic=",oauth_consumer_key="123451",oauth_nonce="1874069178",oauth_signature="K0y6d7q8h3tbm4+hWRNq2WbLrPA=",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1330464984",oauth_version="1.0" Content-Type: application/xml Content-Length: 798


I'm using PHP's CURL to manage the request. Setting the option for CURLINFO_HEADER_OUT dumps what is being posted. I'm trying to determine if my code needs more work or not: I'm not too proud to say 'the problem could be on my end.'

The tool being tested is at http://www.classroom24-7.com/player/index2.php

Thanks in advance.

-------------------------
--
 03/02/2012 07:55 PM
User is offline View Users Profile Print this message

Author Icon
CharlesSeverance

Posts: 50
Joined: 01/23/2009

Does everything work when there is no space in the secret?

/Chuck
 03/03/2012 09:09 AM
User is offline View Users Profile Print this message

Author Icon
CharlesSeverance

Posts: 50
Joined: 01/23/2009

I just did a quick test where I switched the secret in my local copy of lms.php and
tool.php to "secret zzz" and it worked fine - both the launch and the callback for grade setting.

If I look in your output:

V1.0 4f4d48d941c9c failure status OAuth signature failed:
Invalid signature ours= K0y6d7q8h3tbm4+hWRNq2WbLrPA=
yours=K0y6d7q8h3tbm4 hWRNq2WbLrPA= B64key=123451
HDRkey=123451 secret=secret zzz

This comes from the tool_consumer_outcome.php and is showing what it is using as a
secret and correctly seems to be using "secret zzz"

I ran through the code, perhaps suspecting something wrong with the body hash - but the
signature check is done before the hash check and if the signature fail the hash is not
even computed so it is not the hash.

So that narrows this down to a base string check with the only real data in the base
string is the url parameters and the header values.

If you dump out the entire response, you will see in an HTML comment the base string
that the tool_consumer_outcome.php computed. Then print out your base string that
was used in your calling code to compute your signature and then compare them
character by character. Usually when we line up the two base strings - whatever is
wrong jumps out.
 03/13/2012 09:56 AM
User is offline View Users Profile Print this message

Author Icon
jellisii

Posts: 2
Joined: 02/28/2012

Thank you very much for this Dr Chuck.

-------------------------
--
Statistics
2931 users are registered to the IMS GLC Public Forums and Resources forum.
There are currently 0 users logged in.

FuseTalk Standard Edition v3.2 - © 1999-2013 FuseTalk Inc. All rights reserved.

By participating in the forum, you agree to the abide by forum rules. You can view the IMS GLC Privacy Statement