package eu.hsrw.ias.ggd;

import HttpCall.HttpPost;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

public class SecurityToken {

  public static String OnCallMethod(String username, String password)
    throws Exception {
    //CONFIG PARAMETERS:
    //BEGIN------------CONFIG PARAMETERS BELOW TO YOUR ENVIRONMENT---------------------------------------
    String baseURL = "https://api.whysor.com/users/login";
    String devURL = "https://api.dev.whysor.com/users/login";
    final String body = String.format(
      "{\"email\": \"%s\", \"password\": \"%s\", \"domain\": \"my.dev.yookr.org\"}",
      username,
      password
    );
    HttpPost httpMethodPost = new HttpPost();
    return httpMethodPost.HttpCallPost(devURL, body);
  }
}
