public void TestConnectAd(string username, string password) { try { _adService.Authen(username, password); } catch (Exception ex) { Assert.True(false, ex.Message); } }
/// <summary> /// Validate username and password is valid. /// </summary> /// <param name="login">The login value.</param> /// <returns></returns> public ResultViewModel Authenticate(LoginViewModel login) { var result = new ResultViewModel(); if (_adService.Authen(login.Username, login.Password)) { login.Username = $"{_config.DomainUser}{login.Username}"; result = _roleBll.ValidateRole(login.Username); } else { result = UtilityService.InitialResultError(MessageValue.LoginFailed, 401); } return(result); }