static void Main(string[] args) { var client = new ApiClient(); client.AccessUnprotectedResource("samples"); var token = new ISClient().GetResourceOwnerPasswordToken(ConfigurationManager.AppSettings["Is:UserName"], ConfigurationManager.AppSettings["Is:Password"]); // authorized client.AccessProtectedResource("samples", token.AccessToken); Console.ReadLine(); }
static void Main(string[] args) { var client = new ApiClient(); client.AccessUnprotectedResource("samples"); // unauthorized! client.AccessProtectedResource("samples"); // authorized var token = new ISClient().GetClientCredentialToken(); client.AccessProtectedResource("samples", token.AccessToken); Console.ReadLine(); }