private async void button1_Click(object sender, EventArgs e) { try { CognitoHelper cognitoHelper = new CognitoHelper(); cognitoUser = await cognitoHelper.ValidateUser(txtusername.Text, txtpassword.Text); Console.WriteLine(cognitoUser.Username); string bucketsforuser = await cognitoHelper.GetS3BucketsAsync(cognitoUser); MessageBox.Show(bucketsforuser, "Buckets for the users"); } catch (Exception exp) { Console.WriteLine(exp); MessageBox.Show("Unable to validate the username and password"); } }