Example #1
0
        private bool ValidateUser(Mobile.ESig.User user)
        {
            if (null == user)
            {
                return(false);
            }

            // If we have barcode then no need to check un/pw
            if (!string.IsNullOrWhiteSpace(user.BadgeBarcode))
            {
                return(true);
            }

            if (string.IsNullOrWhiteSpace(user.Username))
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(user.Password))
            {
                return(false);
            }
            // if (string.IsNullOrWhiteSpace(user.SelectedDomain)) { return false; }

            return(true);
        }
Example #2
0
        private Domain.Models.RequestModels.AuthModel ConvertUserToDomain(Mobile.ESig.User user)
        {
            Domain.Models.RequestModels.AuthModel domainUser = new Domain.Models.RequestModels.AuthModel(
                user.Username,
                user.Password
                );

            return(domainUser);
        }
Example #3
0
        public async Task <bool> AreCredentialsCorrect(Mobile.ESig.User user)
        {
            var isValid = ValidateUser(user);

            if (!isValid)
            {
                return(false);
            }

            Domain.Models.RequestModels.AuthModel domainUser = ConvertUserToDomain(user);

            // TODO: Call the REST Service for authentication
            var res = await _authService.ValidateLoginAsync(domainUser);

            return(res);
        }