public static async Task <HttpClient> CreateClient() { var client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:8080/"); await Auth.AuthorizeClient(client, "1", LoginUtils.MakePasswordHash("1", "1")); return(client); }
public void TryLogin(string login, string password, Action <bool, string> onComplete) { Login = login; Password = password; Log.MessageFormat("TryLogin: login: '******', password: '******'", LogTags.Auth, login, password); if (!_client.InProgress) { var passwordHash = LoginUtils.MakePasswordHash(login, password); var request = CardUrl.Prepare(_authUrl, login, passwordHash); _client.SendGetRequest(request, onComplete: resp => OnLoginComplete(resp, onComplete)); } }
public static User WithPassword(string login, string password, string name, string role) { return(new User(login, LoginUtils.MakePasswordHash(login, password), name, role)); }