code: protected SecurityHandler createSecurityHandler() throws Exception {
          HashLoginService l = new HashLoginService();
          // UserStore is now separate store entity and must be added to HashLoginService
          UserStore userStore = new UserStore();
          l.setUserStore(userStore);
          for (User user : Users.getUsers()) {
              userStore.addUser(user.getId(), Credential.getCredential(user.getPassword()), user.getRolesAsArray());
          }
          l.setName("apimanrealm");
  
          ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
          csh.setAuthenticator(new BasicAuthenticator());
          csh.setRealmName("apimanrealm");
          csh.setLoginService(l);
  
          return csh;
      }
docs: Creates a basic auth security handler.
  @throws Exception