Assign a rule to a particular user with spring boot code

Hi community,

How can I assign a rule to a particular user with spring boot code ?

Thank you

Hey there!

Not sure what you exactly mean to achieve, but rules are not supposed to work this way. Can you explain a bit more your usecase?

Hey Konrad,

The goal is to trigger MFA authentication for some user and I want to implement it with spring boot.
I saw the doc for the creation of scope and rule Configure Step-up Authentication for APIs
I want to assign this scope which is in a rule for which triggers mfa example:
function(user, context, callback) {

  var CLIENTS_WITH_MFA = ['DGHIqedjTsTUgNwFcwvVeuPYVXrCnBb3'];
  // 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);
}

If you have any other idea how to implement I will be grateful

Thank you