AnsweredAssumed Answered

Need some help with LTI 2.0 registration process

Question asked by Wallison de Oliveira on Jan 18, 2018
Latest reply on May 13, 2018 by chofer@morainepark.edu

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!

Outcomes