Exemple #1
0
 private bool CheckDataContractForLogin(KeystoneAuthUserV41 user)
 {
     if (user == null)
     {
         return(false);
     }
     if (user.Body == null)
     {
         return(false);
     }
     if (user.Body.UserName == null || user.Body.UserName.Trim() == String.Empty)
     {
         return(false);
     }
     if (user.Body.Password == null || user.Body.Password.Trim() == String.Empty)
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
        public KeystoneAuthDataV41 Login(KeystoneAuthUserV41 msg)
        {
            if (!this.CheckDataContractForLogin(msg))
            {
                return(new KeystoneAuthDataV41 {
                    Body = null
                });
            }
            string userName = msg.Body.UserName;

            #region 去满足能够支持带域名(abs_corp/rl53)登录;

            if (msg.Body.UserName.IndexOf('\\') > -1)
            {
                string[] tempStringArray = msg.Body.UserName.Split('\\');
                if (tempStringArray.Length >= 2)
                {
                    userName = tempStringArray[1];
                }
            }

            #endregion
            string password      = msg.Body.Password;
            string domain        = msg.Body.Domain;
            string identityToken = string.Empty;
            bool   b             = AuthFactory.GetInstance().Login(userName, password, ref domain, false, out identityToken);
            if (b)
            {
                TraceLoginEventLog(userName);
                SetAuthFormCookie(userName, domain);
                return(GetAuthData(msg));
            }
            return(new KeystoneAuthDataV41 {
                Body = null
            });
        }
 public KeystoneAuthDataV41 Login(KeystoneAuthUserV41 msg)
 {
     return(GetAuthData(null));
 }