Use scope for some users

Hi
I created this rule with scope “use:mfa” :

  function(user, context, callback) {

      var CLIENTS_WITH_MFA = ['CLIENT_ID'];
      // run only for the specified clients
      if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) {
        // ask for MFA only if scope transfer:funds was requested
        if (context.request.query.scope.indexOf('use:mfa') > -1) {
          context.multifactor = {
            provider: 'any',
            allowRememberBrowser: false
          };
        }
      }

      callback(null, user, context);
    }

How to get “use: mfa” just for some users ? using spring boot code

Or, how to customize the user metadata and activate the MFA for some user via spring boot

function (user, context, callback) {
  var CLIENTS_WITH_MFA = ['CLIENT_ID'];
  // run only for the specified applications
   if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) {
    // uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true
     if (user.user_metadata && user.user_metadata.use_mfa){
      context.multifactor = {
        provider: 'any',
        allowRememberBrowser: false
      };
     }
  }
  callback(null, user, context);
}

Thank you