Exemple #1
0
        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);
        }
Exemple #2
0
 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));
     }
 }
Exemple #3
0
 public static User WithPassword(string login, string password, string name, string role)
 {
     return(new User(login, LoginUtils.MakePasswordHash(login, password), name, role));
 }