Giter Club home page Giter Club logo

Comments (15)

pfgray avatar pfgray commented on July 19, 2024

It looks like oauth_body_hash is required by the lti spec (http://www.imsglobal.org/LTI/v1p1/ltiIMGv1p1.html#_Toc319560469), so this should definitely be added.

I believe the method used to generate the oauth_body_hash must be the same as the algorithm in oauth_signature_method In the commit that you linked, it looks like you're using SHA1 instead of HmacSHA1 in order to generate the oauth_body_hash.

When you say it 'breaks signing,' do you mean that Sakai/Moodle rejects the request based on an incorrect oauth_body_hash, or is it something else?

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

I was able to get through oauth_body_hash validation, so I believe the parameter was not being included in the oauth_signature calculation. (It also made Canvas start rejecting the request, so I'm fairly sure.)

from basiclti-util-java.

pfgray avatar pfgray commented on July 19, 2024

I was dead wrong about the oauth_body_hash algorithm to use, Keep using SHA1. (http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html#anchor3)

If the oauth_signature does not include the oauth_body_hash I would regard it as a bug with oauth-signpost. I'll do some digging as to whether this is actually the case.

Do Moodle and Sakai accept your requests that include oauth_body_hash while Canvas rejects them?

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

I haven't tested against Moodle, but Sakai gave me "Failed to validate: signature_invalid".

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

(It had previously been giving me "Did not find oauth_body_hash", then "Body hash does not match header", as I got it figured out.)

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

And yes, I suspect you're right that it's a bug in oauth-signpost.

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

Perhaps I should just drop the signpost dependency and roll my own, as in https://developer.mastercard.com/portal/display/api/Java+OAuth+Sample+Code .

from basiclti-util-java.

kejd315 avatar kejd315 commented on July 19, 2024

anyone is going to fix this? I just ran into the same issue where oauth_body_hash is not calculated in the request header.

from basiclti-util-java.

pfgray avatar pfgray commented on July 19, 2024

Hi @kejd315, thanks for your interest in basiclti-util-java.

It would be useful to hear a bit more about how you're using this library, and where exactly it's breaking in order to help you.

What version are you currently using? Which method are you using to send POX results to the consumer? Are you also implementing against Sakai?

In recent versions, there have been measures added to allow clients to override the default signing implementation, if you choose to use your own.

from basiclti-util-java.

kejd315 avatar kejd315 commented on July 19, 2024

I am using sendReplaceResult() from https://github.com/IMSGlobal/basiclti-util-java/blob/master/src/main/java/org/imsglobal/pox/IMSPOXRequest.java
The method doesn't generate oauth_body_hash in the request header.

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

I've submitted a pull request for the issue, @kejd315 . Sorry for the trouble.

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

If you're curious, @pfgray , the only problem with my previous patch was that I had to URL-encode the hash value. Embarrassing.

from basiclti-util-java.

kejd315 avatar kejd315 commented on July 19, 2024

This is great news. Regarding the body hash algorithm SHA1 you use, should it be HMAC-SHA1
according to LTI 1.1 spec?

from basiclti-util-java.

bluej100 avatar bluej100 commented on July 19, 2024

Thanks for the review! The oauth body hash extension specifies an unkeyed
hash algorithm:

https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html#unkeyed
On Jan 29, 2015 7:16 PM, "kejd315" [email protected] wrote:

This is great news. Regarding the body hash algorithm SHA1 you use, should
it be HMAC-SHA1
according to LTI 1.1 spec?


Reply to this email directly or view it on GitHub
#3 (comment)
.

from basiclti-util-java.

kejd315 avatar kejd315 commented on July 19, 2024

Thanks for your quick response. This looks good!

from basiclti-util-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.