Search code examples
react-nativepermissionsjwtauth0multi-factor-authentication

Auth0: Conditional multi-factor rule removes permissions from JWT


For some reason enabling MFA (sms code) removes permissions from JWT (access token). I have checked the setup a few times and all seems to be OK, but for the same account without MFA a permissions presented in JWT, with enabled MFA - no. (I do not using webauth)

I have found this 3 topics:

And I think we have the same kind of problem (there is no answer by links).

Code of rule looks like this:

    const userEnrolledFactors = user.multifactor || [];
    const canPromptMfa = userEnrolledFactors.length > 0;

    if(canPromptMfa) {
      context.multifactor = {
        provider: "any",
        allowRememberBrowser: false,
      };
    }

Solution

  • Issue was on Auth0 side. And now it have been fixed on their side enter image description here