Enforce Multi-Factor Authentication on Every Login Using Actions
This article describes how to enforce Multi-Factor Authentication (MFA) on every login event by utilizing Actions. It outlines the steps to configure the authentication policy and implement a specific code snippet to disable the browser remembrance option, ensuring users are prompted for MFA at every sign-in.
-
Actions
-
Multi-Factor Authentication (MFA)
-
Go to the Multi-factor Authentication settings.
-
Set the Require Multi-factor Auth policy to Never.
-
Go to Actions > Flows and select Login.
-
Select the Post-Login trigger.
-
Add the following code to the Action to enable MFA and disable the browser remembrance option:
exports.onExecutePostLogin = async (event, api) => {
api.multifactor.enable("any", {allowRememberBrowser: false});
};