示例#1
0
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="PWD">用户密码</param>
        /// <param name="LoginTicket">登录凭据值</param>
        /// <param name="RedirectUrl">跳转地址</param>
        /// <returns>SSO返回信息</returns>
        public SSOResponse UserLoginAct(string UserName, string PWD, string LoginTicket, string RedirectUrl)
        {
            SSOResponse response = new SSOResponse();
            UserInfo    User     = new UserInfo();

            EyouSoft.SSOComponent.SSORemote.SSOResponse remoteResponse = RemoteLogin.UserLoginAct(UserName, PWD, LoginTicket, RedirectUrl);
            User.ID           = remoteResponse.UserInfo.ID;
            response.IsValid  = remoteResponse.IsValid;
            response.UserInfo = User;
            //SetCache();
            LocalLogin.UpdateUserInfo(User);
            return(response);
        }
示例#2
0
        /// <summary>
        /// 根据用户名、凭据值获取用户信息
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="LoginTicket">登录凭据值</param>
        /// <returns>SSO返回信息</returns>
        public SSOResponse GetTicketUser(string UserName, string LoginTicket)
        {
            SSOResponse response = new SSOResponse();
            UserInfo    User     = new UserInfo();

            EyouSoft.SSOComponent.SSORemote.SSOResponse remoteResponse = RemoteLogin.GetTicketUser(UserName, LoginTicket);
            if (remoteResponse != null && !string.IsNullOrEmpty(remoteResponse.SSOScript))
            {
                response.UserInfo = EyouSoft.Common.SerializationHelper.InvertJSON <UserInfo>(remoteResponse.SSOScript);
                response.IsValid  = remoteResponse.IsValid;
                if (response.UserInfo != null)
                {
                    //response.UserInfo = this.ConvertToUser(remoteResponse.UserInfo);
                    //SetCache();
                    LocalLogin.UpdateUserInfo(response.UserInfo);
                }
            }
            return(response);
        }