public JsonResult Login(string userCode) { string encryptedCode = Cryptography.Encrypt(userCode, DateTime.Now.ToString("yyyyMMdd"), "oms"); var user = McdAMContext.Authenticate(encryptedCode); return(Json(user)); }
protected void btn_Click(object sender, EventArgs e) { string uid = tb1.Text.Trim(); string s = Cryptography.Encrypt(uid, DateTime.Now.ToString("yyyyMMdd"), "oms"); UserInfo userInfo = McdAMContext.Authenticate(s);//Stephen Modified if (userInfo != null) { Response.Redirect("PortalTest.aspx?user-id=" + s); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/javascript"; context.Response.CacheControl = "no-cache"; var userId = context.Request["userid"] ?? ""; userId = userId.Trim(); if (!string.IsNullOrEmpty(userId)) { McdAMContext.Authenticate(userId); } if (McdAMContext.CurrentUser != null) { context.Response.Write(string.Format("window.currentUser = {0};", JsonConvert.SerializeObject(McdAMContext.CurrentUser))); } }
public JsonResult ValidateUser(string userId) { var user = McdAMContext.Authenticate(userId); return(Json(user)); }