private async Task DataPortal_Fetch(IdentityCriteria criteria)
        {
            var adDal = IoC.Container.Resolve<IAuthorizeLogOn>();

            if (adDal.ValidateLogin(criteria.UserName, criteria.Password))
            {
                var dal = IoC.Container.Resolve<ICustomIdentityDAL>();

                var result = await dal.RetrieveIdentityAsync(criteria.UserName) ??
                             InsertUserInfoFromAD(adDal, dal, criteria.UserName);
                this.Load(result.Id, result.ADName, result.Roles);
                this.IsAuthenticated = true;
            }
            else
            {
                throw new System.Security.SecurityException("Unable to login with these credentials");
            }
        }
Beispiel #2
0
        private async Task DataPortal_Fetch(IdentityCriteria criteria)
        {
            var adDal = IoC.Container.Resolve <IAuthorizeLogOn>();

            if (adDal.ValidateLogin(criteria.UserName, criteria.Password))
            {
                var dal = IoC.Container.Resolve <ICustomIdentityDAL>();

                var result = await dal.RetrieveIdentityAsync(criteria.UserName) ??
                             InsertUserInfoFromAD(adDal, dal, criteria.UserName);

                this.Load(result.Id, result.ADName, result.Roles);
                this.IsAuthenticated = true;
            }
            else
            {
                throw new System.Security.SecurityException("Unable to login with these credentials");
            }
        }