Need some help with LTI 2.0 registration process

Need some help with LTI 2.0 registration process

by Wallison de Oliveira -
Number of replies: 0

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

And create a second Moodle vm using this tutorial: How to install Moodle 3.2 on Ubuntu 16.04 but it gave me 400 Bad Request when trying to get ToolConsumerProfile (the tc_profile_url is https://192.168.1.7/mod/lti/services.php/profile/?lti_version=LTI-2p0)


The first Moodle VM gives me 400 Bad Request when trying to post the tool proxy.

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!


Average of ratings: -