WeBWorK Main Forum

LTI 1.3 Failed to obtain access token from LMS:

LTI 1.3 Failed to obtain access token from LMS:

by Troy Welch -
Number of replies: 4

Hi, there should be a special tumbler of scotch for those who get LTI 1.3 working as they need.

I have two problems that both (I believe) have their roots in this error in the logs:
Failed to obtain access token from LMS:

I kind of feel that this error makes this an LMS (Moodle) problem rather than a WW problem, but I'll give it a go anyway.

1st problem: I was working with a pre-release of v2.19 and Moodle 4.4. Any attempt to return a grade resulted in this error.

2nd problem: Released version of v2.19, Moodle 4.4, diffed and update config files, update checks on all WW dependencies. Content Selection:

When adding the external tool object in Moodle:

  • correctly mapped context ID
  • Content Select button populates WW sets
  • Check a set and select button returns: Exception - mod_lti\local\ltiopenid\jwks_helper::fix_jwks_alg(): Argument #1 ($jwks) must be of type array, null given, called in [dirroot]/mod/lti/locallib.php on line 1335
Meanwhile, in the WW debug log:
[Mon Oct 07 12:35:48.866239 2024] WeBWorK::Authen::LTIAdvantage::request_has_data_for_this_verification_module: LTIAdvantage has been called for data verification
[Mon Oct 07 12:35:48.866471 2024] WeBWorK::Authen::LTIAdvantage::request_has_data_for_this_verification_module: LTIAdvantage returning that it has insufficent data

and the webwork2.log
Failed to obtain access token from LMS:

Any insight anyone could bring to bear would sure be appreciated. My boss is starting to think I have an unhealthy addiction to combing the config files.
In reply to Troy Welch

Re: LTI 1.3 Failed to obtain access token from LMS:

by Brian Little -
Hi Troy.

It's been a minute since you posted this. Did you ever fix the problem? I'm having the same issue in Moodle 4.1. 
In reply to Troy Welch

Re: LTI 1.3 Failed to obtain access token from LMS:

by Glenn Rice -
By chance, are the Moodle instance and the WeBWorK instance on the same physical server?
In reply to Glenn Rice

Re: LTI 1.3 Failed to obtain access token from LMS:

by Brian Little -

No, they're actually in different locations entirely. Our .edu Moodle site is hosted by Open LMS, and our WeBWork instance is through Runestone Academy. 

In reply to Brian Little

Re: LTI 1.3 Failed to obtain access token from LMS:

by Glenn Rice -
That eliminates one possibility then. Moodle by default does not allow access to localhost, and so if they were on the same server then a work around needs to be employed.