Skip to content

WebAuthn not allowing security key registration on Totara #422

@jamie-catalyst

Description

@jamie-catalyst

Affected branch: MOODLE_35_STABLE

When attempting to set up a security key on a Totara 16 we came across an issue with setting up security keys. The Register security key button doesn't function and the following error appears in the JS console:

require.js:65 TypeError: amd.init is not a function
    at action.php:1859:59
    at Object.execCb (require.js:117:193)
    at Module.check (require.js:63:341)
    at Module.<anonymous> (require.js:80:35)
    at require.js:16:51
    at require.js:82:75
    at each (require.js:8:77)
    at Module.emit (require.js:82:39)
    at Module.check (require.js:68:83)
    at Module.enable (require.js:81:280)

The problem is that Totara doesn't support the new esm modules that got introduced. In addition Totara and older Moodles can no longer build the JS files.

I highlighted these commits in the MOODLE_35_STABLE as being problematic:

factor_webauthn: Move JS into modules (5e28ce0670e87b9da811f062a885aafe14319c1f)
factor_webauthn: Copy andrewnicols JS fixes (8df3be56c65ca3b776e2f200636d3589f06568e2)
factor_webauthn: Disable submit button on registration page (3abf8e505183b31c6cc5a14097a431552f28101f)

When I reverted those commits I was able to register a security key in Totara without issue.

Are these commits something to remove/refactor in MOODLE_35_STABLE to maintain Totara compatibility?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions