/// <summary> /// Returns authentication details and infos of the current user /// </summary> /// <returns></returns> public async Task <List <UserEntry> > GetAuthenticationtDetails(string pUserName, string pAssword) { var accountlist = new List <UserEntry>(); using (var webclient = new AuthorizedHttpClient("", new Uri("https://authenticate.teamwork.com/"), false)) { var data = await webclient.GetListAsync <UserEntry>( @"accounts/search.json?email=" + pUserName + "&password="******"accounts", null); if (data.StatusCode == HttpStatusCode.OK) { accountlist.AddRange(data.List); } else { throw new Exception(data.Status + " " + data.Message); } } using (var webclient = new AuthorizedHttpClient("", new Uri("https://authenticate.eu.teamwork.com/"), false)) { var data = await webclient.GetListAsync <UserEntry>( @"accounts/search.json?email=" + pUserName + "&password="******"accounts", null); if (data.StatusCode == HttpStatusCode.OK) { foreach (var acc in data.List) { acc.companyname = acc.companyname + "-EU"; } accountlist.AddRange(data.List); } else { throw new Exception(data.Status + " " + data.Message); } } if (accountlist.Count > 0) { return(accountlist); } throw new Exception("No Login found"); }
/// <summary> /// Returns authentication details and infos of the current user /// </summary> /// <returns></returns> public async Task <List <UserEntry> > GetAuthenticationtDetailsTest(string pUserName, string pAssword) { var accountlist = new List <UserEntry>(); using (var webclient = new AuthorizedHttpClient("", new Uri("http://sunbeam.teamwork.dev/"), true)) { var data = await webclient.GetListAsync <UserEntry>( @"accounts/search.json?email=" + pUserName + "&password="******"accounts", null); if (data.StatusCode == HttpStatusCode.OK) { accountlist.AddRange(data.List); } else { throw new Exception(data.Status + " " + data.Message); } } if (accountlist.Count > 0) { return(accountlist); } throw new Exception("No Login found"); }