public async Task Authorize() { String username = CrossSecureStorage.Current.GetValue("username"); String password = CrossSecureStorage.Current.GetValue("password"); Debug.WriteLine("Authorizing..."); await client.LoginAsync(username, password); expirationDate = DateTime.Now.AddSeconds(client.OAuthTokens.ExpiresIn); Debug.WriteLine("New token will expire on " + expirationDate.ToString("dd/MM/yyyy HH:mm:ss")); }
private static async Task Run(string username, string password) { using (var client = new OvClient()) { var loginResponse = await client.LoginAsync(username, password); if (!loginResponse) { return; } Console.WriteLine(JsonConvert.SerializeObject(client.OAuthTokens, Formatting.Indented)); Console.WriteLine(client.AuthorizationToken); var cards = await client.GetCardsAsync(); Console.WriteLine(JsonConvert.SerializeObject(await client.GetTransactionsAsync(cards.Data[0].MediumId), Formatting.Indented)); } }