Skip to content

Event user_failed_mfa never seems to trigger #465

Description

@pjohanneson

I've written a little plugin to log Moodle user authentication successes and failures to a system log. I'm able to see authentication success and failures in the log file, using the built-in \core\event\user_loggedin and \core\event\user_login_failed events.

I discovered that this MFA plugin, which we're using, also provides events: \tool_mfa\event\user_passed_mfa and \tool_mfa\event\user_failed_mfa. I added listeners for those two events to my plugin:

$observers = array(
    //...
    array(
            'eventname' => '\tool_mfa\event\user_passed_mfa',
            'callback'  => '\local_mylogintracker\tracker::mfa_success',
    ), 
    array(
            'eventname' => '\tool_mfa\event\user_failed_mfa',
            'callback'  => '\local_mylogintracker\tracker::mfa_failure',
    ), 
);

I see events for the MFA success event, but no matter how many times I key in a bogus MFA code, I never seem to trigger the \tool_mfa\event\user_failed_mfa event.

Any advice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions