LTI integration with Moodle LMS: Error: The keyset URL did not return a valid JWKS document. Expected a JSON object with a 'keys' array per RFC 7517

Susan Mangan 0 Reputation points
2026-06-10T00:02:24.0533333+00:00

Trying to register MS o365 LTI with Moodle LMS v.4.5.11 as per the instructions on this page: https://learn.microsoft.com/en-us/microsoft-365/lti/microsoft-365-lti-moodle?view=o365-worldwide

The following errors are returned on the last page of the registration process:

Keyset URL:

"The keyset URL did not return a valid JWKS document. Expected a JSON object with a 'keys' array per RFC 7517"

Access Token URL:

"Token acquisition failed. The LMS platform rejected the authentication request. Please verify the client ID and access token URL are correct."

More detail from the web console:

  • Header returns 422 unprocessable entity
  • response: invalid registration "one or more registration keys failed validation
  • Error: lti AccessTokenUri: TokenAquisitionFailed

Multiple attempts have been made to register and have re-confirmed client ID and deployment ID are accurate as per the documentation.

This Moodle instance already has a fully functional existing connection with Azure/Entra using Open ID Connect for SSO and local_365 plugin for user sync.

Help?!!

Thanks in advance!

Microsoft 365 and Office | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-06-10T00:02:55.3633333+00:00

    The error messages indicate that Moodle cannot validate the LMS public keyset URL and cannot complete the OAuth token flow for the Microsoft 365 LTI registration.

    Based on the documented setup and troubleshooting guidance, the following checks and actions apply:

    1. Validate the LMS public keyset URL
      • The Microsoft LMS Gateway requires a valid JWKS document from the LMS public keyset URL.
      • Ensure that the Public keyset URL copied from the Moodle tool configuration details is entered exactly in the Microsoft registration portal under Keyset URL.
      • Confirm that this URL is reachable and not blocked by network or firewall rules for requests originating from https://lti.microsoft.com/.
      • If the public keyset URL is incorrect or inaccessible, the Microsoft registration portal will raise the error: “The keyset URL did not return a valid JWKS document. Expected a JSON object with a 'keys' array per RFC 7517.”
      • Correct the URL in the registration and retry.
    2. Reconfirm all LMS-provided registration keys For Moodle, the Microsoft registration portal expects the following values copied from the Moodle tool configuration details:
      • Issuer ID URL: Platform ID
      • Client ID: Client ID
      • Keyset URL: Public keyset URL
      • Platform authentication URL: Authentication request URL
      • Deployment ID: Deployment ID
      • Access token URL: Access token URL (for Microsoft 365 LTI and Teams Assignments LTI)
      Verify each field carefully against the Moodle “View configuration details” modal. Any mismatch (especially Client ID or Access token URL) can cause the “Token acquisition failed. The LMS platform rejected the authentication request” error.
    3. Verify the Access token URL
      • Ensure the Access token URL from Moodle is copied exactly into the Microsoft registration portal.
      • If the Access token URL is wrong or incomplete, the LMS will reject the authentication request and the portal will report AccessTokenUri: TokenAquisitionFailed.
    4. Confirm the registration flow order
      • In Moodle:
        1. Configure the external tool (Microsoft 365 LTI / Microsoft Education) with the values from the Microsoft registration portal.
        2. Save changes.
        3. Open View configuration details for the tool and copy the Platform ID, Client ID, Public keyset URL, Authentication request URL, Deployment ID, and Access token URL.
      • In the Microsoft registration portal:
        1. Select Next to the LMS-provided registration keys page.
        2. Paste each value into the corresponding field.
        3. Select Next, then Review and save and Save.
    5. Check for incomplete or deleted registrations
      • If the registration was partially completed or deleted in Microsoft LMS Gateway, the portal can report registration validation errors.
      • Re-run the registration from scratch, ensuring all steps are completed in one flow.
    6. Network and cookie considerations (for launch issues after registration)
      • If launch issues occur after registration, ensure third-party cookies are allowed for the LMS URL in the browser, as required for the LTI 1.3 handshake.
      • Also ensure the public keyset URL is not blocked by network settings.
    7. Escalation to Microsoft Education Support
      • If the public keyset URL and Access token URL are confirmed correct and accessible, but the Microsoft registration portal still reports JWKS or token acquisition errors, LMS admins should contact Microsoft Education Support for deeper investigation of the LMS–Gateway interaction:

    These steps align with the documented Moodle and generic LTI registration flows and the LMS Gateway troubleshooting guidance, focusing specifically on the public keyset URL and Access token URL validation.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.