Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4615

How to respond to POST by a Ruby on Rails LTI 1.1 or 1.3 provider? Very little to go on out there

$
0
0

I'm pretty inexperienced with both stackoverflow and Ruby. Please help me to help you to help me.

I'm trying to implement ims-lti in an open-source Rails application. I have created a class and user in my web app. I have created a class and external tool assignment in Moodle. When I select the tool in Moodle with a user, I can see the appropriate POST, but I never see my web app respond. What do I need to do in my Rails app in order to respond to the post?

Moodle request: POST https://152.7.177.3/lti/launch

Web app:

Route:
get 'lti/launch' and post 'lti/launch' => 'lti#launch'

class LtiController < ApplicationController skip_before_action :verify_authenticity_token, only: [:launch] def launch  # Attempting to track the function call. Never gets called.  puts "IN LAUNCH"  Rails.logger.info "IN LAUNCH"  tp = IMS::LTI::ToolProvider.new(   ENV['LTI_KEY'],   ENV['LTI_SECRET'],   params  )  if tp.valid_request?(request)   user = User.find_or_create_by(email: tp.lis_person_contact_email_primary) do |u|    u.name = tp.lis_person_name_full    u.role = tp.roles.first  end   # sign user in here   redirect_to root_path, notice: 'Logged in successfully via LTI'  else   render plain: "Invalid LTI request", status: 401   puts 'HEREHERE'  end endend

Viewing all articles
Browse latest Browse all 4615

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>