Ejemplo n.º 1
0
        public JsonResult Login(string userCode)
        {
            string encryptedCode = Cryptography.Encrypt(userCode, DateTime.Now.ToString("yyyyMMdd"), "oms");
            var    user          = McdAMContext.Authenticate(encryptedCode);

            return(Json(user));
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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)));
            }
        }
Ejemplo n.º 4
0
        public JsonResult ValidateUser(string userId)
        {
            var user = McdAMContext.Authenticate(userId);

            return(Json(user));
        }