Example #1
0
    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();
    }
Example #2
0
    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();
    }