Register for InstructureCon25 • Passes include access to all sessions, the expo hall, entertainment and networking events, meals, and extraterrestrial encounters.
Found this content helpful? Log in or sign up to leave a like!
We, at cehe.instructure (IU), trying to implement USU-tools, also known as Kennethware2.0 and came across an error that points at line 45 in TrivialOAuthDataStore.php. Also, to note we do have all HTTPS and no need to use http and associated to it encryption and etc.. Any advice is greatly appreciated as well as any source-code updates.
Here is copy of ERR:
Strict Standards: Declaration of TrivialOAuthDataStore::new_request_token() should be
compatible with OAuthDataStore::new_request_token($consumer, $callback = NULL)
in/home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/resources/TrivialOAuthDataStore.php on line 45
------------------------------------------------------------------------------------------------------------
Solved! Go to Solution.
Thanks for asking for clarification.
Lets start with a quick vocabulary clarification:
An LTI tool can be created without using a Canvas Developer Key, however an LTI tool that does not use a Canvas Developer Key cannot request user OAuth tokens from Canvas.
Here is a description of the variables:
OAuth Handshake
In order to obtain an OAuth token for a user, the following takes place:
To address some of your other items:
Let me know if there is anything else you need clarified
I am going to ping @kenneth_larsen and see if he can offer some assistance on this.
Hi @tatiana_peisl ,
The TrivialOAuthDataStore.php file came from IMS Global (the learning consortium that is responsible for the LTI standard) and handles the process of retrieving an OAuth token from Canvas. This is the first time I have heard of anyone encountering this error during an install. I am inclined to think that the issue lies in the config setup rather than an issue with that file.
As far as the USU Design Tools (aka Kennethware) is concerned, there are three variables in the config.php file that are used for the OAuth retrieval process:
Some things you can check:
var_dump($_GET);
echo '<hr>';
var_dump($userToken);
exit;
Requesting Developer Credentials from Canvas
To host and create LTI tools from Canvas you need developer credentials. You can request these credentials by completing the Canvas Developer Key Request.
Let me know if everything above is working but you are still getting the error message.
Hi Kenneth,
Thanks for advice, I will go through the code and update
Warm Regards,
Tatiana Peisl (MISM; MS Applied Math.)
Curriculum Development Online
Center for Excellence in Higher Education
Hi Kenneth,
Just want to verify if my understanding is correct about how it works.
LTI work not only with Canvas Developer Key, any user with appropriate credentials can generate "token", which is canvas key used to authenticate user.
In the CONFIG part of your tools there is static assignment of variables that hold a single user credentials: $client_id, $clientSecret, $lti_secret, $canvasDomain, and $apiToken. Also it has DB credentials and $pass and $salt for encryption.
Config is using OAuth.php and TrivialOAuthDataStore.php to verify credential from MySQL DB. What happened to those statically assigned variables?
I failed to find where those credentials are INSERT into tools DB.
Now, because there is nothing in DB inserted, SELECT return no rows and request is moving further to TrivialOAuthDataStore.php to ask to issue "token" and >> because we have no Canvas Developer Key we got cut short.
My impression was that is there is no Canvas Developer Key, at least the tool should work for explicitly defined users.
Is that correct?
We need to use only a single user credentials when no Canvas Developer Key is available.
Does the tool has ability by passing this situation ?
Thanks in advance,
Tatiana
Thanks for asking for clarification.
Lets start with a quick vocabulary clarification:
An LTI tool can be created without using a Canvas Developer Key, however an LTI tool that does not use a Canvas Developer Key cannot request user OAuth tokens from Canvas.
Here is a description of the variables:
OAuth Handshake
In order to obtain an OAuth token for a user, the following takes place:
To address some of your other items:
Let me know if there is anything else you need clarified
Hi Kenneth,
Finally we got ID and KEY from canvas. I edited that in config.php. also, I added recommended lines of code in oauth2response.php.
added to oauth2response.php in line #25 as advised
=============================
var_dump($_GET);
echo '<hr>';
var_dump($userToken);
exit;
I do get "login" window but when I click on "Login" button, it breaks with following errors:
Strict Standards: Declaration of
TrivialOAuthDataStore::new_request_token() should be compatible with
OAuthDataStore::new_request_token($consumer, $callback = NULL) in/home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/resources/TrivialOAuthDataStore.php on
line 45
Strict Standards: Declaration of
TrivialOAuthDataStore::new_access_token() should be compatible with
OAuthDataStore::new_access_token($token, $consumer, $verifier = NULL) in/home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/resources/TrivialOAuthDataStore.php on
line 45
Notice: Undefined index: canvasURL in /home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/oauth2response.phpon
line 12
Warning:
file_get_contents(/login/oauth2/token?client_id=25330000000000002&client_secret=secret&code=4384502fbd18b394ecc32c0afa61245fe6e6c57d22fc7c4d09e32a94f3b887039787627ffc6454c29c9f8436bf082200fb61f0cd588a550d043fba4e38e18083):
failed to open stream: No such file or directory in/home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/oauth2response.php on
line 14
============================
Before adding suggested code I was getting error same as above and plus
============== the below-- was fixed with your (Kenneth) suggested code==============
Notice: Trying to get property of non-object in /home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/oauth2response.php on line 29
Notice: Undefined index: userID in /home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/oauth2response.php on line 32
Notice: Undefined index: apiDomain in /home4/iucdtcom/public_html/user/~tatiana/kennethware/wizard/oauth2response.php on line 36
having canvas_user_id and domain noted as NULL in
QUERY: INSERT INTO `tokens` )
ERROR: Column 'canvas_user_id' cannot be null
=========================================
Any advice is deeply appreciated.
Thanks in advance.
Is the server you are making the call from secure (https)?
I would also recommend replacing any ID's or other such codes in your posts in the forum with ### or something similar.
Thanks Kenneth,
That clarifies a lot
Tatiana
To interact with Panda Bot in the Instructure Community, you need to sign up or log in:
Sign In