0.02
No commit activity in last 3 years
No release in over 3 years
OmniAuth strategy for providing LTI authentication to an OmniAuth application
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

OmniAuth LTI

The OmniAuth LTI gem provides a way for applications to authenticate users using LTI 1.1 specification.

It relies on ims-lti gem for validating LTI data.

Installation

Add the gem in your Gemfile:

gem 'omniauth-lti'

And install it using bundle

bundle install

Usage

Add the provider to your OmniAuth stack, giving the tool_consumer credentials:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :lti, :oauth_credentials => {:test => 'secret'}
end

Include Omniauth::Lti::Context in your application_controller:

class ApplicationController < ActionController::Base
  ...
  include Omniauth::Lti::Context
  ...
end

When you create the session in your sessions\_controller, call to save_lti_context for saving LTI context through all the application

For accessing the context anywhere in your application, just call the helper method lti_tool_provider. For instance, to show the title of the resource that call your application just put in your haml view:

=lti_tool_provider.resource_link_title

You can find an example web application in omniauth-lti-example-webapp

Outcomes

lti_tool_provider gives you the full IMS::LTI::ToolProvider class. Please refer to (https://github.com/instructure/ims-lti#returning-results-of-a-quizassignment) to see how to do outcomes with this class