示例#1
0
        public string Login()
        {
            if (!AppSSOBLL.TOEACAuthenticat("01", AppSSOBLL.GetTimeStamp(), InterfaceUtility.GetNodeValueForConfig("BackUrl"), ""))
            {
                return(JSONHelper.FromString(true, "连接成功"));
            }

            return(JSONHelper.FromString(true, "连接失败"));
        }
示例#2
0
        public string Valiadate()
        {
            //接受EAC发送回来的认证信息,如果通过定位到保护页面
            if (_request["IASID"] != null)
            {
                if (_request["Result"].ToString() == "0")
                {
                    var account  = _request["Account"].ToString();
                    var eacToken = _request["IASID"].ToString();

                    if (AppSSOBLL.ValidateFromEAC(eacToken,
                                                  _request["TimeStamp"].ToString(),
                                                  _request["UserAccount"].ToString(),
                                                  _request["Result"].ToString(),
                                                  _request["ErrorDescription"].ToString(),
                                                  _request["Authenticator"].ToString())
                        )
                    {
                        HKLogin.LoggedUsers.AddOrUpdate(account, new HKUserModel()
                        {
                            Account          = account,
                            EACToken         = eacToken,
                            LastActivityTime = DateTime.Now
                        }, (key, value) =>
                        {
                            value.Account          = account;
                            value.EACToken         = eacToken;
                            value.LastActivityTime = DateTime.Now;
                            return(value);
                        });

                        // 登录成功
                        return(JSONHelper.FromString(true, eacToken));
                    }
                }
            }

            return(JSONHelper.FromString(false, "账号或密码错误"));
        }