title: wso2 identity server 5.7.0 How write Script for Role1?
body: <p>I want Use this link:</p>
  <p><a href="https://docs.wso2.com/display/IS570/Adaptive+Authentication" rel="nofollow noreferrer">https://docs.wso2.com/display/IS570/Adaptive+Authentication</a></p>
  <p>I want Role1 Can't Login to my Application and Write this Code:
  and it's Don't Work and Role1 can login to my application.
  How can Write this script?</p>
  <pre><code>  // Role-Based from Template...
  
  // This script will step up authentication for any user belonging
  // to one of the given roles
  // If the user has any of the below roles, authentication will be stepped up
  var rolesToStepUp = ['Role1'];
  
  function onLoginRequest(context) {
      executeStep(1, {
          onSuccess: function (context) {
              // Extracting authenticated subject from the first step
              var user = context.currentKnownSubject;
              // Checking if the user is assigned to one of the given roles
              var hasRole = hasAnyOfTheRoles(user, rolesToStepUp);
              if (hasRole) {
                  Log.info(user.username + ' Has one of Roles: ' + rolesToStepUp.toString());
                return false;
              }
          }
      });
  }
  
  // End of Role-Based.......
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Kuey6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kuey6.png" alt="enter image description here" /></a></p>