OAuth LTI Ошибка: запрос не проверяется?
Я пытаюсь обновить устаревшее приложение, чтобы использовать версию LTI ruby gem 2.2.
В настоящее время я не могу получить запросы Oauth для проверки с использованием следующего:
authenticator = IMS::LTI::Services::MessageAuthenticator.new(@request.url, @params, secret)
authenticator.valid_signature?
Насколько я могу судить, я не уверен, что является причиной этого, поскольку это должен быть действительный запрос. Вот дампы задействованных переменных:
Стандартное приложение 9783: --- Ключ OAUTH ====> ocill-lti-key Стандартное приложение 9783: --- Секрет OAUTH ====> УДАЛЕНО! Stdout приложения 9783: --- ЗАПРОСИТЬ URL https://lrc-tesuto.lrc.lsa.umich.edu/ocill/launch/create Stdout приложения 9783: --- REQUEST PARAMS {"oauth_consumer_key"=>"ocill-lti- ключ", "oauth_signature_method"=>"HMAC-SHA1", "oauth_timestamp"=>"1510067228", "oauth_nonce"=>"70h3qDQemquvfZeKZ03OIJt5Me06hmoUuA4DEscIgQ", "oauth_version"=>"1,0", "context_id"=>"de25c863939f3cacfc02480738d072d95597842c", "context_label"=>"Песочница johnathb", "context_title" => "Учебный курс по холсту для johnathb", "custom_canvas_assignment_points_possible"=>"10", "custom_canvas_assignment_title"=>"Тест постановки OCILL", "custom_canvas_teroll"> "custom_canvas_enrollment" active "," ext_ims_lis_basic_outcome_url "=>" https://umich.instructure.com/api/lti/v1/tools/10530/ext_grade_passback "," ext_lti_assignment_id "=>" f9139721-be1f-473a-91b5-6a08a747474746060 ext_outcome_data_values_accepted "=>" url, text ", "ext_outcome_result_total_score_accepted "=>" true ", "ext_outcomes_tool_placement_url "=>" https://umich.instructure.com/api/lti/v1/turnitin/outcomes_placement/10530 ement / 10530 "," ext_roles "=>" urn: lti: instrole: ims / lis / Administrator, urn: lti: instrole: ims / lis / Instructor, urn: lti: instrole: ims / lis / Student, urn: lti: role:ims/lis/Instructor,urn:lti:sysrole:ims/lis/User", "launch_presentation_document_target"=>"iframe", "launch_presentation_locale"=>" en "," launch_presentation_return_url "=>" https://umich.instructure.com/courses/56125/external_content/success/external_tool_redirect "," lis_outcome_service_url "=>" https://umich.instructure.com/api/lti/v1/tools/10530/grade_passback "," lti_message_type "= > "basic-lti-launch-request", "lti_version" => "LTI-1p0", "oauth_callback" => "about: blank", "resource_link_id" => "52e0499f9ed929340aec886dd08c7035e45471f5", "resource_link_titClell =" Тест " "роли"=> "Инструктор", "tool_consumer_info_product_family_code"=>"холст", "tool_consumer_info_version"=>"облако", "tool_consumer_instance_contact_email"=>"notifications@instructure.com", "tool_consumer_instance_guid"=>"7db438071375c02373713c12c73869ff2f470b68.umich.instructure.com", "tool_consumer_instance_name"=>"Университет Мичигана - Анн-Арбор", "user_id"=>"1ec00186b63b783a994fd2d5b7648ba6cdfe9807", "oauth_signature"=>"7jq4lBIBYoMzIeShPZbPNJjOrEs=", "контроллер"=> "пуск", "действие" => "создать"}
Stdout приложения 9783: --- AUTHENTICATOR INSPECT ===> #"ocill-lti-key", "oauth_signature_method"=>"HMAC-SHA1", "oauth_timestamp"=>"1510067228", "oauth_nonce"=>"70h3HIQUQEQEQEQUQEQEQEQEQEQUQUQEQD, "oauth_version"=>"1.0", "context_id"=>"de25c863939f3cacfc02480738d072d95597842c", "context_label"=>"Песочница johnathb", "context_title" => "Учебный курс по холсту для johnathb", "custom_po_se__name >__po_> >______t_> "," custom_canvas_assignment_title "=>" Промежуточный тест OCILL ", "custom_canvas_enrollment_state"=>" активный "," ext_ims_lis_basic_outcome_url "=>" https://umich.instructure.com/api/lti/v1/tools/10530/ext_grade_passback, "ext_lti_assignment_id"=>"f9139721-be1f-473a-91b5-6a08a386074c", "ext_outcome_data_values_accepted"=>"url,text", "ext_outcome_result_total_score_accepted"=> true> " _t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_t_m instructure.com/api/lti/v1/turnitin/outcomes_placement/10530 "," ext_roles "=>" urn: lti: instrole: ims / lis / Administrator, urn: lti: instrole: ims / lis / Instruc tor, urn: lti: instrole: ims / lis / Student, urn: lti: роль:ims/lis/Instructor,urn:lti:sysrole:ims/lis/User", "launch_presentation_document_target"=>"iframe", "launch_presentation_locale" "=>" ru "," launch_presentation_return_url "=>" https://umich.instructure.com/courses/56125/external_content/success/external_tool_redirect "," lis_outcome_service_url "=>" https://umich.instructure.com/api/lti/v1/tools/10530/grade_passback "," lti_message_type "=>" basic-lti-launch-request "," lti_version "=>" LTI-1p0 "," oauth_callback "=>" about: blank ", "resource_link_id" => "52e0499f9ed929340aec886dd08c7035e45471f5", "resource_link_title" => "Промежуточный тест OCILL", "role" => "Инструктор", "tool_consumer_info_product_family_code" => холст ", case_con_server" " => "notifications@instructure.com", "tool_consumer_instance_guid" => "7db438071375c02373713c12c73869ff2f470b68.umich.instructure.com", "tool_consumer_instance_name" => "Университет Мичигана - Энн Арбор", "user_id" => 1 00186b63b783a994fd2d5b7648ba6cdfe9807", "oauth_signature" => "7jq4lBIBYoMzIeShPZbPNJjOrEs =", "контроллер" => "пуск", "действие" => "создать"}, @options={: CONSUMER_KEY => "ocill-LTI-ключ",:signature_method=>"HMAC-SHA1",:timestamp=>"1510067228",:nonce=>"70h3qDQemquvfZeKZ03OIJt5Me06hmoUuA4DEscIgQ",:version=>"1.0",:callback=>"about:blank"}, @parsed_idms={parsed_idms =>"de25c863939f3cacfc02480738d072d95597842c",:context_label=>"Песочница johnathb",: context_title => "Учебный курс по холсту для johnathb",:custom_canvas_assignment_points_possible=>"10",:___t_t_t_t_> active ",: ext_ims_lis_basic_outcome_url =>" https://umich.instructure.com/api/lti/v1/tools/10530/ext_grade_passback ",: ext_lti_assignment_id =>" f9139721-be1f-473a-91b5-6a08aata_value_value_value_val_80_c_80_c_60_c_60_60_c_60_60 > "url, текст",: ext_outcome_result_total_score_accepted => "true",: ext_outcomes_tool_placement_url => " https://umich.instructure.com/api/lti/v1/turnitin/outcomes_placement/10530 в / resultss_placement / 10530 ",: ext_roles =>" urn: lti: instrole: ims / lis / Administrator, urn: lti: instrole: ims / lis / Instructor, urn: lti: instrole: ims / lis / Student, urn: lti: role: ims / lis / Instructor, urn: lti: sysrole: ims / lis / User ",: launch_presentation_document_target =>" iframe ",: launch_presentation_locale =>" en ",: launch_presentation_return_url =>" https://umich.instructure.com/courses/56125/external_content/success/external_tool_redirect ",: lis_outcome_service_url =>" https://umich.instructure.com/api/lti/v1/tools/10530/grade_passback ",: lti_message_type =>" basic- lti-launch-request ",: lti_version =>" LTI-1p0 ",: resource_link_id =>" 52e0499f9ed929340aec886dd08c7035e45471f5 ",: resource_link_title =>" Тест подготовки OCILL ",: role =>" Инструктор ",: код_инструмента_интерфейса_интерфейса_интерфейса_интерфейса_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интерфейс_интернет,:tool_consumer_info_version => "облако",:tool_consumer_instance_contact_email=>"notifications@instructure.com",:tool_consumer_instance_guid=>"7db438071375c02373713c12c73869ff2f470b68.umich.instructuresu" instance_name => "Университет Мичигана - Энн Арбор",:user_id=>"1ec00186b63b783a994fd2d5b7648ba6cdfe9807",:controller=>"launch",:action=>"create"}, @consumer_key="ocill-lti-key", @Signature="7jq4lBIBYoMzIeShPZbPNJjOrEs=", @secret="УДАЛЕНО!", @Message=#"10", "custom_canvas_assignment_title"=>"Промежуточный тест OCILL", "custom_canvas_enrollment_state" = >ur_____t__t_t_t_t_t_t_t_t_t_s_t_t_t_s_s_e_s_m_s_s_t_t_t_s_t_t_s_s_s_t_e_s_s_t_e_s_s_t_t_t_s_s_t_t_s_t_t_t_t_s_t_t_t_t_t_t_t_t_t_l_t_t_t_t_t_t_t_t_t_t_t_t_t_t_tj_t_t_tj также также является активным => " https://umich.instructure.com/api/lti/v1/tools/10530/ext_grade_passback ", "ext_lti_assignment_id" => "f9139721-be1f-473a-91b5-6a08a386074c", "ext_outcome_data_values_aclpted" =>, текст ", "ext_outcome_result_total_score_accepted "=>" true ", "ext_outcomes_tool_placement_url "=>" https://umich.instructure.com/api/lti/v1/turnitin/outcomes_placement/10530 "," ext_roles "=>" urn: LTI: instrole: ИМС / лис / Администратор, урна: LTI: instrole: ИМС / лис / инструктор, урна: LTI: instrole: ИМС / лис / Student, урна: LTI: роль: ИМС / лис / инструктор, урна: LTI:sysrole:ims/lis/User"}, @unknown_params={"controller"=>"launch", "action"=>"create"}, @oauth_consumer_key="ocill-lti-key", @oauth_signature_method="HMAC-SHA1", @oauth_timestamp="1510067228", @oauth_nonce="70h3qDQemquvfzeKZMa0_0_0_0_0" _0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_5 "de25c863939f3cacfc02480738d072d95597842c", @context_label="Песочница johnathb", @context_title="Обучающий курс по холсту для johnathb", @launch_presentation_document_target="iframe", @launch_presentation_um.ch = "" = " ru /courses/56125/external_content/success/external_tool_redirect", @lis_outcome_service_url="https://umich.instructure.com/api/lti/v1/tools/10530/grade_passback", @lti_message_type="basic-lti-launch- " request", @lti_version="LTI-1p0", @oauth_callback="about:blank", @resource_link_id="52e0499f9ed929340aec886dd08c7035e45471f5", @resource_link_title="OCILL Staging Test", @role = холст, @tool_consumer_info_version = "облако", @tool_consumer_instance_contact_email = "Notifications@instructure.com", @tool_consumer_instance_guid="7db438071375c02373713c12c73869ff2f470b68.umich.instructure.com", @tool_consumer_instance_name="Университет штата Мичиган - Анн-Арбор", @user_id="1ec00186b63b783a994fd2d5b7648ba6cdfe9807", @oauth_signature="7jq4lBIBYoMzIeShPZbPNJjOrEs=" @launch_url="https://lrc-tesuto.lrc.lsa.umich.edu/ocill/launch/create">, @simple_oauth_header=#https://lrc-tesuto.lrc.lsa.umich.edu/ocill/launch/create>, @params={:context_id=>"de25c863939f3cacfc02480738d072d95597842c",:context_label=>"Песочница johnathb",: context_title => "Учебный курс по холсту для johnathb",: custom_canvas_assignment_points> point_points_points_points__points_points__points_points__t_t__t__t_ "Промежуточный тест OCILL",:custom_canvas_enrollment_state=>"активный",: ext_ims_lis_basic_outcome_url => " https://umich.instructure.com/api/lti/v1/tools/10530/ext_grade_passback ",: ext_lti_assignment_id => f99 -473a-91b5-6a08a386074c ",: ext_outcome_data_values_accepted =>" url, text ",: ext_outcome_result_to tal_score_accepted => "true",: ext_outcomes_tool_placement_url => " https://umich.instructure.com/api/lti/v1/turnitin/outcomes_placement/10530 ",: ext_roles => "urn: lti: instrole: ims / lis / Администратор, урна: LTI: instrole: ИМС / лис / инструктор, урна: LTI: instrole: ИМС / лис / Student, урна: LTI: роль: ИМС / лис / инструктор, урна: LTI: sysrole: ИМС / лис / Пользователь",: launch_presentation_document_target => "iframe",: launch_presentation_locale => "en",: launch_presentation_return_url => " https://umich.instructure.com/courses/56125/external_content/success/external_tool_redirect ": lis_l_seture_service>: lis_loutserser> https://umich.instructure.com/api/lti/v1/tools/10530/grade_passback ",: lti_message_type =>" basic-lti-launch-request ",: lti_version =>" LTI-1p0 ",: resource_link_id =>" 52e0499f9ed929340aec886dd08c7035e45471f5 ",: resource_link_title =>" Промежуточный тест OCILL ",: роль =>" Инструктор ",:. }, @options={:nonce=>"70h3qDQemquvfZeKZ03OIJt5Me06hmoUuA4DEscIgQ",:signature_method=>"HMAC-SHA1",:timestamp=>"1510067228",:version=>"1.0", customer_cill-lti-oti => ",: callback =>" about: blank ",: consumer_secret =>" УДАЛЕНО!"}} >>
1 ответ
Оказывается, проблема в том, что в моем запросе были дополнительные параметры, которые были переданы.
Вместо этого использовал следующее для генерации параметров для валидатора:
params = request.query_parameters.merge(request.request_parameters)