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