public async Task <UserModel> LoginActiveDirectory([FromBody] LoginModel model) { if (await ldapRepository.Login(model) == OperationStatus.OK) { HttpContext.AddAuthorizationHeader(encryptor.Encrypt(model.Username.Substring(0, model.Username.IndexOf("@")))); var user = await applicationUserService.GetUserByName(model.Username); return(user); } Unauthorized(); return(null); }
public async Task <bool> AuthenticateUser(string login, string senha) { return(await ldapRepository.Login(login, senha)); }