public static async Task <Usuario> ValidarCredencialesAdmin(string strUsuario, string strClave) { try { string strEncryptedPassword = Utilitario.EncriptarDatos(strClave); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; HttpResponseMessage httpResponse = await httpClient.GetAsync(strServicioURL + "/validarcredencialesadmin?usuario=" + strUsuario + "&clave=" + strEncryptedPassword); if (httpResponse.StatusCode == HttpStatusCode.InternalServerError) { string strError = httpResponse.Content.ReadAsStringAsync().Result; throw new Exception(strError); } if (httpResponse.StatusCode != HttpStatusCode.OK) { throw new Exception(httpResponse.ReasonPhrase); } string responseContent = await httpResponse.Content.ReadAsStringAsync(); string strResponse = serializer.Deserialize <string>(responseContent); Usuario usuario = serializer.Deserialize <Usuario>(strResponse); return(usuario); } catch (Exception ex) { throw ex; } }