Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wallison_olivei
New Member

Need some help with LTI 2.0 registration process

Jump to solution

Hey guys, I'm developing a Java Tool Provider using LTI 2.0.

Using IMS LTI Tool Consumer emulator I can made my Tool Proxy pass the registration process with 201 code, but when trying it on Moodle or Canvas I can't.

I'm using this Vagrant Box with canvas: Vagrant box supersoftware/canvas-lms - Vagrant Cloud

Moodle keeps giving me 400 Bad Request.

Canvas gives me 401 Unauthorized or 500 Internal Server Error

Canvas gives me 401 if I use this to get oauth_body_hash

public static String signBodyHash(String requestBody) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        MessageDigest md = MessageDigest.getInstance("SHA1");
        byte[] output = Base64.encodeBase64(md.digest(requestBody.getBytes()));
        String bodyHash = new String(output);
        return URLEncoder.encode(bodyHash, "UTF-8");
 }

And 500 if I use this code:

    public static String signBodyHash(String requestBody) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        MessageDigest md = MessageDigest.getInstance("SHA1");
        byte[] output = Base64.encodeBase64(md.digest(requestBody.getBytes()));
        String bodyHash = new String(output);
        return bodyHash;
  }

I attached the Tool Consumer Profile, the registration request parameters (reg_key and reg_password), Tool Proxy and the OAuth headers.

If someone could give some tip or clarify what I'm doing wrong I'll be very grateful!

1 Solution

Accepted Solutions

Hi Chris, thanks for your reply. I'm really glad that Canvas Community has a concern about older questions.

Unfortunately I'm not working with LTI anymore, but I did find a solution after some weeks.

The problem was with my Moodle and Canvas local server, when setting up my own Canvas server with Docker, as proposed on GitHub's README I've could get it working.

And on Production Server of our client, it worked when I used HTTPS instead of HTTP. (Only on Canvas, Moodle was still giving me 400 Bad Request)

But I found another alternative to the LTI 2.0 Registration Process, using the EduAppCenter. With EduAppCenter I can register my Tool Provider with no problems on Canvas and Moodle.

View solution in original post

5 Replies
stuart_ryan
Community Coach
Community Coach

Hi  @wallison_olivei  and Welcome to the Canvas Community,

This one has me scratching my head, so I am going to share this to the great minds in the https://community.canvaslms.com/groups/canvas-developers?sr=search&searchId=f80bb827-fb4d-4271-ae2b-...‌ group! Hopefully someone in there may be able to point you in the right direction with their experiences in the awesomeness of LTIs.

Hope that helps!
Stuart

chofer
Community Coach
Community Coach

Greetings,  @wallison_olivei !

I have been reviewing older questions here in the Canvas Community, and I came across your question.  I don't necessarily have an answer for you, but I wanted to check in with you.  It appears as though you have possibly stumped members of the Canvas Community with your question.  Have you been able to come up with any solutions on your own since you first posted this question on January 18, 2018?  If so, would you be willing to share what you've learned?  Of, if you are still looking for some help with this question, please let us know by posting a message below.  Hopefully someone from the Community will be able to chime in and assist you.  For now, I am going to mark your question as "Assumed Answered"...not because we've necessarily found an answer for you...but more because we've not seen any new activity in this topic for almost four months.  However, that won't prevent you or others from posting additional questions and/or comments below that are related to this topic.  I hope that's alright with you, Wallison.  Looking forward to hearing back from you soon.

Hi Chris, thanks for your reply. I'm really glad that Canvas Community has a concern about older questions.

Unfortunately I'm not working with LTI anymore, but I did find a solution after some weeks.

The problem was with my Moodle and Canvas local server, when setting up my own Canvas server with Docker, as proposed on GitHub's README I've could get it working.

And on Production Server of our client, it worked when I used HTTPS instead of HTTP. (Only on Canvas, Moodle was still giving me 400 Bad Request)

But I found another alternative to the LTI 2.0 Registration Process, using the EduAppCenter. With EduAppCenter I can register my Tool Provider with no problems on Canvas and Moodle.

 @wallison_olivei ...

Thank you for the update!  I'm glad to know that you've found a solution for your question.  I've gone ahead and marked your response as "Correct".  Thanks again!