Closed RaghavReddy closed 3 years ago
Hello! I think your issue is that you are running your LTI Provider on localhost:
provider:platform Attempting to generate new access_token for https://canvas.instructure.com +0ms
In order to generate an access token, the Canvas instance has to reach your LTI Provider and retrieve the public key list, this doesn't work if you are running Ltijs on localhost on a different machine.
Thanks a lot for the quick response! really appreciate it.
@RaghavReddy @Cvmcosta I am running into the same issue but I am running the app in the development server. Can you explain this a little more "In order to generate an access token, the Canvas instance has to reach your LTI Provider and retrieve the public key list"
Hello @dcheruiy! In order for the Platform to validate some requests it needs to reach the Tool's public key set, so this URL needs to be accessible from the Platform. If one of them is not accessible via the internet, the flow does not work.
So if the platform is: canvas.instructure.com AND my LTI tool is running at example.com URL
How do I make example.com be accessible from canvas.instructure.com. Is there more configuration that needs to happen after I have created the LTI key and installed the Tool?
Thank you for your quick reply.
Are both of them accessible via the internet? What is the actual URL for the Canvas instance?
Trying to access the Tool URL gives me ERR_ADDRESS_UNREACHABLE
. As long as both of them are accessible via the internet you shouldn't have issues related to that.
@Cvmcosta I get the same error. My error Message is Failed sending grade to platform! HTTPError: 500.
You mean that the canvas instance must be hostet on a server so that it is accessable from the internet, and the LTI App should also be accessable from the internet.
So my canvas instance ist hosted and accessible from the internet and my canvas LTI App is running over nkrog-tunnle, so it is also accessible. But I am getting the error message. When I use only localhost as you descibed before it is also not working.
Describe the bug I'm running the Example Ltijs Server, when I click on "submit grade" I'm getting
Failed sending grade to platform! HTTPError: Internal Server Error
Expected behavior Post grades to the canvas
Provider logs provider:main Attempting to connect to database +0ms provider:database Database connected +0ms provider:database Database connection open +3ms provider:main Ltijs started listening on port: 3000 +39ms
| | | | | | |/ __| | | | | | | | | (__
| | | | | | | |_ \ | |_| | | |_ | || |) | |__|| |____()/|/
LTI Provider is listening on port 3000!
LTI provider config:
Starting in Dev Mode, state validation and session cookies will not be required. THIS SHOULD NOT BE USED IN A PRODUCTION ENVIRONMENT! provider:main Platform already registered +28ms provider:main Receiving request at path: /grade +7m provider:main Path does not match reserved endpoints +0ms provider:main Cookies received: +0ms provider:main [Object: null prototype] { provider:main 'ltiaHR0cHM6Ly9jYW52YXMuaW5zdHJ1Y3R1cmUuY29tMTYxMDgwMDAwMDAwMDAwMTA3MTUwOjY2Y2FjNTJkODY4N2UyZTBmYjJmOTM3ODc0YzM1ZjdlZTE5ZGU4YWU%3D': 'a711bf8e-7a3a-464b-952d-5cd48d142cfc' provider:main } +0ms provider:main LTIK found +1ms provider:main LTIK successfully verified +2ms provider:main Attempting to retrieve matching session cookie +0ms provider:main Dev Mode enabled: Missing session cookies will be ignored +0ms provider:auth Valid session found +0ms provider:main Passing request to next handler +16ms provider:gradeService Target platform: https://canvas.instructure.com +0ms provider:gradeService Attempting to retrieve platform access_token for [https://canvas.instructure.com] +3ms provider:platform Valid access_token for https://canvas.instructure.com not found +0ms provider:platform Attempting to generate new access_token for https://canvas.instructure.com +0ms provider:platform With scopes: https://purl.imsglobal.org/spec/lti-ags/scope/lineitem https://purl.imsglobal.org/spec/lti-ags/scope/score +0ms provider:auth Awaiting return from the platform +0ms Response code 500 (Internal Server Error)
Screenshots
Ltijs version
NodeJS version
Platform used
Additional context await lti.registerPlatform({ url: 'https://canvas.instructure.com', name: 'Canvas sandbox', clientId: 'XXXXXXXXX', authenticationEndpoint: 'https://kaplanlabs.instructure.com/api/lti/authorize_redirect', accesstokenEndpoint: 'https://kaplanlabs.instructure.com/login/oauth2/token', authConfig: { method: 'JWK_SET', key: 'https://kaplanlabs.instructure.com/api/lti/security/jwks' } })