/**
   * Get unregistered required actions
   *
   * <p>Returns a list of unregistered required actions.
   */
  @Path("unregistered-required-actions")
  @GET
  @Produces(MediaType.APPLICATION_JSON)
  @NoCache
  public List<Map<String, String>> getUnregisteredRequiredActions() {
    auth.requireView();

    List<ProviderFactory> factories =
        session.getKeycloakSessionFactory().getProviderFactories(RequiredActionProvider.class);
    List<Map<String, String>> unregisteredList = new LinkedList<>();
    for (ProviderFactory factory : factories) {
      RequiredActionFactory requiredActionFactory = (RequiredActionFactory) factory;
      boolean found = false;
      for (RequiredActionProviderModel model : realm.getRequiredActionProviders()) {
        if (model.getProviderId().equals(factory.getId())) {
          found = true;
          break;
        }
      }
      if (!found) {
        Map<String, String> data = new HashMap<>();
        data.put("name", requiredActionFactory.getDisplayText());
        data.put("providerId", requiredActionFactory.getId());
        unregisteredList.add(data);
      }
    }
    return unregisteredList;
  }
  /**
   * Get required actions
   *
   * <p>Returns a list of required actions.
   */
  @Path("required-actions")
  @GET
  @Produces(MediaType.APPLICATION_JSON)
  @NoCache
  public List<RequiredActionProviderRepresentation> getRequiredActions() {
    auth.requireAny();

    List<RequiredActionProviderRepresentation> list = new LinkedList<>();
    for (RequiredActionProviderModel model : realm.getRequiredActionProviders()) {
      RequiredActionProviderRepresentation rep = toRepresentation(model);
      list.add(rep);
    }
    return list;
  }