PHP Classes

Work with Canvas LTI?

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Work with Canvas LTI?  >  (Un) Subscribe thread alerts  
Subject:Work with Canvas LTI?
Summary:Does this package work with Canvas LTI for grade passback?
Messages:4
Author:Ted Cowan
Date:2015-03-01 01:19:33
 

  1. Work with Canvas LTI?   Reply   Report abuse  
Picture of Ted Cowan Ted Cowan - 2015-03-01 01:19:33
I am receiving this message when I attempt to authenticate in a Canvas LTI app that will eventually pass back a grade:

Error: it was not possible to access the OAuth request token: it was returned an unexpected response status 302 Response: <html><body>You are being <a href="https://xxx.instructure.com/login?needs_cookies=1">redirected</a>.</body></html>

I am using the following entry which I created in the .json file (and I admit that I guessed):

"Canvas":
{
"oauth_version": "1.0",
"request_token_url": "https://xxx.instructure.com/oauth/request_token",
"dialog_url": "https://xxx.instructure.com/oauth/authorize",
"access_token_url": "https://xxx.instructure.com/oauth/access_token",
"token_request_method": "POST"
},

  2. Re: Work with Canvas LTI?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-03-01 01:40:53 - In reply to message 1 from Ted Cowan
302 is a redirection status code. It means that the real URL that should be accessed is different.

Currently the class supports URL redirection but not for requesting access tokens.

Anyway, accessing that API documentation, I only found OAuth 2 instructions. Shouldn't you be using OAuth 2 instead?

canvas.instructure.com/doc/api/file ...

  3. Re: Work with Canvas LTI?   Reply   Report abuse  
Picture of Ted Cowan Ted Cowan - 2015-03-01 02:26:50 - In reply to message 2 from Manuel Lemos
Thanks for the quick response.

OAuth 2 is used for Canvas API access, but the LTI documentation (https://canvas.instructure.com/doc/api/file.tools_intro.html) states that the LTI integration is based on the LTI 1.1 specification (http://www.imsglobal.org/LTI/v1p1/ltiIMGv1p1.html). LTI 1.1 is implemented with OAuth 1.0.

I have OAuth 2.0 working in my own code, as it was very easy to implement. However, I can find no additional information in Canvas about LTI integration or OAuth 1.0 and it may be time to talk to Instructure.

I was hoping that someone had successfully used your (amazing, I have been perusing your code) OAuth API with an LTI Extermal App.

  4. Re: Work with Canvas LTI?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-03-01 02:39:01 - In reply to message 3 from Ted Cowan
It seems OAuth 1.0 is used only for signing the requests to the server. There seems to not exist an OAuth 1.0 token for that.

You can try using the class Sign function for that purpose although it is not documented.