Simple LTI app for providing google-drive integration into CanvasLMS
Features:
This app uses:
1) Create a Google app on the Google Developer Console.
2) Enable access to the Drive API for the newly created Google app
3) Create credentials for accessing the Google app
Under "Authorized redirect URIs" enter the same URL as above, with /google-auth/callback
at
the end
This will give you the OAuth2 credentials to be used in this app to access the Google app.
4) Go to the "Domain verification" tab and verify the domain this app is running on.
To configure this app with your new credentials, first create your .env
file by running cp .env.template .env
and then modify with your new Google credentials:
SESSION_SECRET=[Generate a string here with SecureRandom.hex(32)]
GOOGLE_KEY=[Your Google client ID]
GOOGLE_SECRET=[Your Google client secret]
Install dependencies and create the database:
bundle install
bundle exec rake db:create db:migrate
For deploying (not development) you should also precompile assets:
bundle exec rake assets:clean assets:precompile
For running the server:
ruby app.rb
you can have an interactive console with the app configured and imported, using:
bundle exec rake console
To launch the Google Drive Connector app from a Canvas instance, see this wiki:
uses Rspec: bundle exec rspec
you can check the coverage report on coverage/index.html
/
[GET]
plain/text
with the project name/config.xml
[GET]
application/xml
with the config./credentials/new
[GET]
/credentials
[POST]
used internally
/google-auth
[GET]
/google-auth/callback
[GET]
All LTI launch requests are done via POST
/lti/gdrive-list
[POST]
session user
, google credentials
and csrf token
folder_id
: list the contents of this foldersearch_term
: term to search on the user's drive file namesaction
: which kind of action should be enabled when a file is selected/lti/course-navigation
[POST]
lti request
and google credentials
/lti/editor-selection
[POST]
link
or embed
the file in the content.lti request
and google credentials
/lti/resource-selection
[POST]
lti request
and google credentials
/lti/link-selection
[POST]
lti request
and google credentials
resource-selection
and link-selection
are the same./lti/resources/:file_id
[POST]
lti request
/lti/homework-submission
[POST]
lti request
and google credentials
/lti/documents
[POST]
session user
, google credentials
and csrf token
/lti/documents/:file_id
[POST]
LtiLinkItem
object on Canvas.lti request
This project is licensed under GPL3