The way that these tools create pages does not require an OAuth token or use of the API in any way. Canvas is kind enough that if you go to a page that doesn't exist, it will create that page for you. The buttons to create a front page or a template page are simply links to the current course with the desired page name. The issues you are experiencing are due to a configuration error where you are not able to make API calls.
One if the initial things that can cause this problem is that the tools must be loaded from a secure (https) server for the OAuth exchange to take place.
Here is an overview of the OAuth process (as it takes place in this tool):
- The tool is launched from Canvas passing information like Course ID and user information to the wizard/controller.php file.
- Lines 23-24 of controller.php use the IMS global files to authenticate the tool launch using the LTI secret specified on line 31 of config.php. If the launch is valid, it will move on, otherwise it will throw the error message set on line 34 of config.php.
- The controller.php file will use the database login credentials provided in lines 17-20 of config.php to see if there is an existing OAuth token for the current user.
- If there is a token, controller.php will run a quick API call to make sure the call is valid (lines 41-52). If the token is valid, it will redirect to the index page. If the token is not valid, it will move to step four.
- If there is not a token, or the token is invalid, controller.php (line 57) will redirect to the OAuth2 login page. This redirect also includes the developer credentials specified in config.php lines 27-28. These credentials come from Instructure (Current UI) or I believe can be defined at the institution level for the new UI. This ends up being one of the things that is missed the most often when people are having issues with the install.
- If the developer credentials are valid and the user authorizes the app, Canvas will return a code to oauth2response.php. This code and the developer credentials are sent to Canvas to be exchanged for an OAuth token (oauth2response.php lines 9-14).
- The OAuth token retrieved from Canvas is encrypted using the pass and salt variables from config.php and then stored in the database (oauth2response.php lines 31-17) and the tool redirects to the index page.
Your error is happening somewhere in those six steps (specifically steps 4-6). Since almost all of that interaction is a matter of passing your developer credentials to Canvas, that is why that is the primary thing you want to check. The client_id should be a number (around 15 characters long?) and the clientSecret is a random string (around 64 characters in length?). You should have received this information after requesting developer tokens from Canvas. These tokens are connected to the server that you registered when you requested the token and will not work on a different server.
Once you have double/triple checked that you are passing the correct credentials you can move on to troubleshooting the response from Canvas.
To troubleshoot the response, replace the oauth2response.php file with the one that I have attached to this post. I have added some lines to output the responses from Canvas to help you identify if this is working. When it is working, revert to the original.
Once this process is complete, you should have an encrypted OAuth token in your database for the user ID you used to launch the LTI tool. With that token, you should go directly to the index page without needing to authorize again and all of the rest of the errors should disappear.