Installation

Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Lorenzo Ng -
Number of replies: 7

So I have the consumer_secret in the .conf files and entered it in moodle. 

but sso is not happening and all I got when it was redirected was

Warning: There may be something wrong with this question. Please inform your instructor including the warning messages below.

The course 90210-school uses an external authentication system (Moodle). Please return to that system to access this course.

I looked the log and saw this..

[me@oursite logs]$ tail  debug.log

[Fri Feb 02 17:12:55.158163 2024] WeBWorK::Authen::LTIAdvanced::authenticate: tool_consumer_info_version->|2022112807|

[Fri Feb 02 17:12:55.158204 2024] WeBWorK::Authen::LTIAdvanced::authenticate: context_type->|CourseSection|
[Fri Feb 02 17:12:55.161789 2024] WeBWorK::Authen::LTIAdvanced::authenticate: construction of Net::OAuth object failed: Missing required parameter 'consumer_secret' at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced.pm line 484.
[Fri Feb 02 17:12:55.161907 2024] WeBWorK::Authen::LTIAdvanced::authenticate: eval failed: <br /><br />
[Fri Feb 02 17:12:55.162043 2024] WeBWorK::Authen::LTIAdvanced::verify_normal_user: auth_result=|0|
[Fri Feb 02 17:12:55.162232 2024] WeBWorK::Authen::write_log_entry: Writing to login log: 'LOGIN FAILED Construction of OAuth request record failedjsmith - authentication failed: 0 user_id=jsmith login_type=normal credential_source=LTIAdvanced host=10.193.32.66 port=59192 UA=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0'.
[Fri Feb 02 17:12:55.162711 2024] WeBWorK::Authen::verify: END VERIFY
[Fri Feb 02 17:12:55.162781 2024] WeBWorK::Authen::verify: result 0
[Fri Feb 02 17:12:55.162832 2024] (eval): Bad news: authentication failed!
[Fri Feb 02 17:12:55.162874 2024] (eval): Rendering WeBWorK::ContentGenerator::Login

How can it be that I get the consumer_secret missing?

 Net::OAuth object failed: Missing required parameter 'consumer_secret'

In reply to Lorenzo Ng

Re: Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Glenn Rice -

You need to double check your configuration files carefully.  The only reason that the error you are getting would occur is if the $LTI{v1p1}{BasicConsumerSecret} variable is not defined in authen_LTI_1_1.conf, or if it is defined somewhere else that is loaded later and set to be the empty string (or undef).

In reply to Glenn Rice

Re: Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Lorenzo Ng -

it is there ..

in fact it shows it in the debugger

  • oauth_consumer_key => mysecretkey

In reply to Lorenzo Ng

Re: Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Danny Glin -

The consumer secret and the consumer key are two different things.

In reply to Glenn Rice

Re: Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Lorenzo Ng -
Now trying LTI 1.3 and like before not debug shown on screen but did capture this in the log


===> Begin WeBWorK::dispatch() <===
[Mon Feb 05 10:55:13.521497 2024] (eval): Hi, I'm the new dispatcher!
[Mon Feb 05 10:55:13.521586 2024] (eval): --------------------------------------------------------------------------------
[Mon Feb 05 10:55:13.521643 2024] (eval): Okay, I got some basic information:
[Mon Feb 05 10:55:13.521723 2024] (eval): The site location is /webwork2
[Mon Feb 05 10:55:13.521776 2024] (eval): The request method is POST
[Mon Feb 05 10:55:13.522055 2024] (eval): The URI is /webwork2/ltiadvantage/login
[Mon Feb 05 10:55:13.522165 2024] (eval): The argument string is iss=https%3A%2F%2Fmoodle.oursite.com&target_link_uri=https%3A%2F%2Fwebwork.oursite.com%2Fwebwork2%2F90210-vcc&login_hint=3090&lti_message_hint=%7B%22cmid%22%3A2942345%2C%22launchid%22%3A%22ltilaunch3714_15352446%22%7D&client_id=OURLTI1-3-SECRET-CLIENT-ID&lti_deployment_id=2315
[Mon Feb 05 10:55:13.522223 2024] (eval): --------------------------------------------------------------------------------
[Mon Feb 05 10:55:13.522336 2024] (eval): The path is /ltiadvantage/login/
[Mon Feb 05 10:55:13.522428 2024] (eval): The current route is ltiadvantage_login
[Mon Feb 05 10:55:13.522482 2024] (eval): Here is some information about this route:
[Mon Feb 05 10:55:13.522794 2024] (eval): The display module for this route is WeBWorK::ContentGenerator::LTIAdvantage
[Mon Feb 05 10:55:13.522879 2024] (eval): This route has the following captures:
[Mon Feb 05 10:55:13.522933 2024] (eval):       action => login
[Mon Feb 05 10:55:13.522978 2024] (eval):       controller => LTIAdvantage
[Mon Feb 05 10:55:13.523016 2024] (eval):       courseID => 90210-vcc
[Mon Feb 05 10:55:13.523055 2024] (eval): --------------------------------------------------------------------------------
[Mon Feb 05 10:55:13.523101 2024] (eval): Now we want to look at the parameters we got.
[Mon Feb 05 10:55:13.523147 2024] (eval): The raw params:
[Mon Feb 05 10:55:13.523210 2024] (eval):       lti_deployment_id => "2315"
[Mon Feb 05 10:55:13.523266 2024] (eval):       lti_message_hint => "{"cmid":2942345,"launchid":"ltilaunch3714_15352446"}"
[Mon Feb 05 10:55:13.523310 2024] (eval):       iss => "https://moodle.oursite.com"
[Mon Feb 05 10:55:13.523357 2024] (eval):       login_hint => "3090"
[Mon Feb 05 10:55:13.523405 2024] (eval):       target_link_uri => "https://webwork.oursite.com/webwork2/90210-hola"
[Mon Feb 05 10:55:13.523452 2024] (eval):       client_id => "OURLTI1-3-SECRET-CLIENT-ID"
[Mon Feb 05 10:55:13.523519 2024] (eval): --------------------------------------------------------------------------------
[Mon Feb 05 10:55:13.523567 2024] (eval): We need to get a course environment (with or without a courseID!)
[Mon Feb 05 10:55:13.532411 2024] (eval): Here's the course environment: WeBWorK::CourseEnvironment=HASH(0x5642b0f3c550)
[Mon Feb 05 10:55:13.570867 2024] (eval): Using user_authen_module WeBWorK::Authen::LTIAdvanced: WeBWorK::Authen::LTIAdvanced=HASH(0x5642b1041c90)
[Mon Feb 05 10:55:13.571008 2024] (eval): We got a courseID from the route, now we can do some stuff:
[Mon Feb 05 10:55:13.571080 2024] (eval): ...we can create a database object...
[Mon Feb 05 10:55:13.606681 2024] (eval): (here's the DB handle: WeBWorK::DB=HASH(0x5642ac3a0ce8))
[Mon Feb 05 10:55:13.606847 2024] WeBWorK::Authen::verify: BEGIN VERIFY
[Mon Feb 05 10:55:13.606920 2024] WeBWorK::Authen::LTIAdvanced::request_has_data_for_this_verification_module: LTIAdvanced has been called for data verification
[Mon Feb 05 10:55:13.606980 2024] WeBWorK::Authen::LTIAdvanced::request_has_data_for_this_verification_module: LTIAdvanced returning that it has insufficent data
[Mon Feb 05 10:55:13.631454 2024] WeBWorK::Authen::verify: BEGIN VERIFY
[Mon Feb 05 10:55:13.631595 2024] WeBWorK::Authen::do_verify: db ok
[Mon Feb 05 10:55:13.631681 2024] WeBWorK::Authen::get_credentials: self is WeBWorK::Authen::LDAP=HASH(0x5642ac1f5118)
[Mon Feb 05 10:55:13.631945 2024] WeBWorK::Authen::fetchCookie: found no cookie for this course. returning nothing.
[Mon Feb 05 10:55:13.632493 2024] WeBWorK::Authen::verify: END VERIFY
[Mon Feb 05 10:55:13.632570 2024] WeBWorK::Authen::verify: result 0
[Mon Feb 05 10:55:13.632641 2024] (eval): Bad news: authentication failed!
[Mon Feb 05 10:55:13.632711 2024] (eval): Rendering WeBWorK::ContentGenerator::Login


In reply to Lorenzo Ng

Re: Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Glenn Rice -

If you are trying to use LTI 1.3, then you need to make sure that you have "{ '*' => 'WeBWorK::Authen::LTIAdvantage' }" listed in your "$authen{user_module}" variable.  You may think you do, but you clearly do not based on the debug output that you just posted.  If it were there then you would see "User user_authen_module WeBWorK::Authen::LTIAdvantage ..." in your output.

In reply to Glenn Rice

Re: Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Lorenzo Ng -

I gave a question about the tool url

When we set up the plug-in for the entire school to use for their moodle course, do we set the tool url to the based url or actual course url for WW?

For example;

Weswork.oursite.com/webwork2 or do we use

WeBWorK.oursite.com/webwork2/my-course-name?

If we use the latter and someone in moodle chooses that tool their WeBWorK course won’t be used correct?

If we setup the client-Id in the server, then the lti tool should only use the base url and exclude the WW course references right? 

What does the user select then when adding that lti activity in moodle?  


Attempting to see the logic and tie-in of the client is, lti tool url setup and what the user selects when they add it to their moodle course


Thanks 

In reply to Glenn Rice

Re: Moodle LTI 1.1 - consumer_secret for SSO - Missing required parameter 'consumer_secret'?

by Lorenzo Ng -
it is there, and uncommented and also set as v1p3 for lti version

authen_LTI.conf

$authen{user_module} = [
        { '*' => 'WeBWorK::Authen::LTIAdvantage' },          # first try LTI 1.3
        { '*' => 'WeBWorK::Authen::LTIAdvanced' },           # next try LTI 1.1
        { "*" => "WeBWorK::Authen::LDAP" },
        { '*' => 'WeBWorK::Authen::Basic_TheLastOption' }    # fallback authorization method
];

$LTIVersion = 'v1p3';