If you are using the ScreenPal LTI v1.3 application with a self-hosted instance of Moodle, you may encounter a "401 Unauthorized" error message when ScreenPal tries to synchronize data with your Moodle Gradebook. This can occur when a student finishes a quiz, for example.
This error occurs when Apache (a common web server on the Bitnami software platform recommended by Moodle for self-hosting) strips out the "HTTP_AUTHORIZATION" header for incoming requests. This header is required in order for the ScreenPal LTI app to correctly synchronize with Gradebook.
To fix this issue, you must modify the httpd.conf file on the machine where Moodle is hosted. The location of this file may vary from machine to machine. One common location for the file is: /opt/bitnami/apache/conf/httpd.conf
You can also typically find the file by opening a Command prompt on the machine and running the following command: find / -iname “httpd.conf” 2>/dev/null
1. After you locate the httpd.conf file, open it and add the following lines to the bottom:
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
SetEnvIf Content-Type "(.*)" HTTP_CONTENT_TYPE=$1
SetEnvIf Accept "(.*)" HTTP_ACCEPT=$1
2. Next, restart Apache.
If the location of the httpd.conf file was /opt/bitnami/apache/conf/httpd.conf, you can likely locate the restart script at /opt/bitnami/scripts/apache/restart.sh.
After Apache is restarted, you should be able to sucessfully use the ScreenPal LTI application to sync ScreenPal quiz scores to your Gradebook.