public VMUserLoginRespose Authenticate(VMUserLogin userLogin, byte[] Key, byte[] IV) { userLogin.Password = Convert.ToBase64String(_coreRepository.EncryptString(userLogin.Password, Key, IV)); UserMaster user = _repository.Authenticate(userLogin); var token = _coreRepository.TokenGenerator(user); VMUserLoginRespose loginRespose = new VMUserLoginRespose(); loginRespose.Token = token; loginRespose.RoleID = user.Role; loginRespose.UserName = user.UserName; return(loginRespose); }