Пример #1
0
        /// <summary>
        /// 用户退出
        /// </summary>
        /// <param name="UID">用户编号</param>
        /// <param name="RedirectUrl">跳转地址</param>a
        /// <returns>SSO返回信息</returns>
        public SSOResponse UserLogout(string UID, string RedirectUrl)
        {
            //RemoveCache();
            LocalLogin.UserLogout(UID);
            SSOResponse response = new SSOResponse();

            EyouSoft.SSOComponent.SSORemote.SSOResponse remoteResponse = RemoteLogin.UserLogout(UID, RedirectUrl);
            response.IsValid = remoteResponse.IsValid;
            return(null);
        }
Пример #2
0
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="PWD">用户密码</param>
        /// <param name="LoginTicket">登录凭据值</param>
        /// <param name="RedirectUrl">跳转地址</param>
        /// <returns>SSO返回信息</returns>
        public SSOResponse UserLoginPassword(string UserName, string PWD, string LoginTicket, PasswordType PwdType)
        {
            SSOResponse response = new SSOResponse();

            SSORemote.PasswordType _pwdtype = (EyouSoft.SSOComponent.SSORemote.PasswordType)Convert.ToInt32(PwdType);
            EyouSoft.SSOComponent.SSORemote.SSOResponse remoteResponse = RemoteLogin.UserLoginPassword(UserName, PWD, LoginTicket, _pwdtype);
            response.IsValid  = remoteResponse.IsValid;
            response.UserInfo = this.ConvertToUser(remoteResponse.UserInfo);
            //SetCache();
            LocalLogin.UpdateUserInfo(response.UserInfo);
            return(response);
        }
Пример #3
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);
        }
Пример #4
0
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="sso">sso信息</param>
        public void UpdateUserInfo(SSOResponse sso)
        {
            //SetCache();
            if (sso == null)
            {
                return;
            }
            LocalLogin.UpdateUserInfo(sso.UserInfo);

            EyouSoft.SSOComponent.SSORemote.SSOResponse remoteresponse = new EyouSoft.SSOComponent.SSORemote.SSOResponse();
            remoteresponse.SSOScript = EyouSoft.Common.SerializationHelper.ConvertJSON <UserInfo>(sso.UserInfo);
            RemoteLogin.UpdateUserInfo(remoteresponse);
        }
Пример #5
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();

            EyouSoft.SSOComponent.SSORemote.SSOResponse remoteResponse = RemoteLogin.UserLoginAct(UserName, PWD, LoginTicket, RedirectUrl);
            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.IsEnable)
                {
                    //response.UserInfo = this.ConvertToUser(remoteResponse.UserInfo);
                    //SetCache();
                    LocalLogin.UpdateUserInfo(response.UserInfo);
                }
            }
            return(response);
        }
Пример #6
0
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="PWD">用户密码</param>
        /// <param name="LoginTicket">登录凭据值</param>
        /// <param name="PwdType">登录密码类型</param>
        /// <returns>SSO返回信息</returns>
        public SSOResponse UserLoginPassword(string UserName, string PWD, string LoginTicket, PasswordType PwdType)
        {
            SSOResponse response = new SSOResponse();

            SSORemote.PasswordType _pwdtype = (EyouSoft.SSOComponent.SSORemote.PasswordType)Convert.ToInt32(PwdType);
            EyouSoft.SSOComponent.SSORemote.SSOResponse remoteResponse = RemoteLogin.UserLoginPassword(UserName, PWD, LoginTicket, _pwdtype);
            if (remoteResponse != null && !string.IsNullOrEmpty(remoteResponse.SSOScript))
            {
                response.IsValid  = remoteResponse.IsValid;
                response.UserInfo = EyouSoft.Common.SerializationHelper.InvertJSON <UserInfo>(remoteResponse.SSOScript);
                if (response.UserInfo != null && response.UserInfo.IsEnable)
                {
                    //response.UserInfo = this.ConvertToUser(remoteResponse.UserInfo);
                    //SetCache();
                    LocalLogin.UpdateUserInfo(response.UserInfo);
                }
            }
            return(response);
        }
Пример #7
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);
        }
Пример #8
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="UID">用户编号</param>
        /// <returns>用户信息</returns>
        public SSOResponse GetUserInfo(string UID)
        {
            //GetCache();
            SSOResponse response = new SSOResponse();
            UserInfo    User     = LocalLogin.GetUserInfo(UID);

            if (User == null)
            {
                EyouSoft.SSOComponent.SSORemote.SSOResponse remoteresponse = RemoteLogin.GetUserInfo(UID);

                if (remoteresponse != null && !string.IsNullOrEmpty(remoteresponse.SSOScript))
                {
                    User = EyouSoft.Common.SerializationHelper.InvertJSON <UserInfo>(remoteresponse.SSOScript);
                    if (User != null)
                    {
                        LocalLogin.UpdateUserInfo(User);
                    }
                }
            }
            response.UserInfo = User;
            return(response);
        }