public string CheckValidationUser(string userid, string ipaddress, string serialno, string scanversion) // { string result = string.Empty; using (AuthenticationBLL authenBll = new AuthenticationBLL()) { result = authenBll.CheckValidationUser(userid, ipaddress, serialno, scanversion); } return(result); }
public IPrincipal CreatePrincipal(string username, string password) { bool isAuthen = false; string userRole = string.Empty; using (AuthenticationBLL authenBll = new AuthenticationBLL()) { isAuthen = authenBll.CheckApiAuthen(username, password, out userRole); } if (isAuthen) { var identity = new GenericIdentity(username); //get roles for user IPrincipal principal = new GenericPrincipal(identity, new[] { userRole }); return(principal); } else { return(null); } }