ltijs: Cannot connect to self-hosted Canvas lms

I have tried ltijs to connect to our self-hosted Canvas at http://dvseok.shop but I cannot get token in function lti.onConnect, it returend undefined. this is our config:

await lti.registerPlatform({
    url: "http://dvseok.shop",
    name: "dvseok",
    clientId: "10000000000003",
    authenticationEndpoint: "http://dvseok.shop/api/lti/authorize_redirect",
    accesstokenEndpoint: "http://dvseok.shop/login/oauth2/token",
    authConfig: {
      method: "JWK_SET",
      key: "http://dvseok.shop/api/lti/security/jwks",
    },
  });

I also tried with your demo project ltijs-demo-server and ltijs-demo-client, when I go to browser of ltijs-demo-client, it always displayed Failed retrieving members! Error: Missing lti key..

I tried to calling a GET request /info demo server with my Canvas LTI key. This is the response:

{
    "status": 401,
    "error": "Unauthorized",
    "details": {
        "message": "Error validating LTIK or IdToken",
        "errorLog": "jwt malformed"
    }
}

Am I missing anything? Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

My pleasure! Feel free to contact me if you have any more doubts: cvmcosta@gmail.com

@Cvmcosta fully supported me to solve this. Again, thank you very much!

@ludalex Oh, this was sometime ago, but as far as i remember the issue was the LTI Placement, when you create the LTI Key on Canvas you set the Placements (specific locations within Canvas) in which you want to use your application. I suggest using Assignment Selection or Global Navigation to test initially.

Just to give closure to this issue in case anyone finds this: The problem was in the placement of the LTI tool, the configurations were all ok.

Can you share with me what the logs say when the error occurs?

DEBUG=provider:* npm start