How to enable 2fa options when enabling it via rules

Hey, I’m trying to implement something on my app where a few users don’t need to use 2fa and the rest does.

I got that working using a rule with the following code:

api.multifactor.enable("any", { allowRememberBrowser: false })

The issue is that this will pick one of the providers and not let the user decide which one they want to use, which is the case when I don’t enable it via a rule as I have that option enabled.

Is there a way to force 2fa via rule but let the user pick the provider instead?

Thanks!

Hi @tech20,

Welcome to the Auth0 Community!

First, let me clarify that the api.multifactor.enable() method is actually meant for Actions and not Rules. See this reference for clarity.

Yes, to do so you will need to go to your Auth0 Dashabord > Security > Multi-factor Auth and scroll to the bottom of the page to enable the Show Multif-factor Authentication Options feature:


(Reference: Enable Multi-Factor Authentication)

Please let me know how this goes for you.

Thanks,
Rueben

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.