Skip to content

Instantly share code, notes, and snippets.

@joshcanhelp
Created December 7, 2021 18:58
Show Gist options
  • Save joshcanhelp/52a97dec582bff831b9c2243d366801a to your computer and use it in GitHub Desktop.
Save joshcanhelp/52a97dec582bff831b9c2243d366801a to your computer and use it in GitHub Desktop.
Step-up authentication in Auth0 using Actions
exports.onExecutePostLogin = async (event, api) => {
const CLIENTS_NEEDING_MFA = [
"CLIENT_ID_NEEDING_MFA_1",
"CLIENT_ID_NEEDING_MFA_2"
];
if (!CLIENTS_NEEDING_MFA.includes(event.client.client_id)) {
return;
}
if (event.request.query.acr_values !== "AuthID_MFA_ACR"){
return;
}
api.multifactor.enable("any", { allowRememberBrowser: false });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment