Example #1
0
 public WrapperImpersonationContext(string domain, string username, string password, CredentialsType type)
 {
     _domain   = domain;
     _username = username;
     _password = password;
     _type     = type;
 }
Example #2
0
 public CredentialsTypeVM(CredentialsType bo)
 {
     this.ID          = bo.ID;
     this.Name        = bo.Name;
     this.Description = bo.Description;
     this.SortCode    = bo.SortCode;
 }
Example #3
0
 public Passenger(string name, PassengerType type, string certificateNumber, CredentialsType certificateType, string mobilephone)
 {
     Name = name;
     Type = type;
     CertificateNumber = certificateNumber;
     CertificateType   = certificateType;
     Mobilephone       = mobilephone;
 }
Example #4
0
 internal DatastoreCredentials(CredentialsType type, AccountKeySection accountKey, CertificateSection certificate, SasSection sas, ServicePrincipalSection servicePrincipal, SqlAdminSection sqlAdmin)
 {
     Type             = type;
     AccountKey       = accountKey;
     Certificate      = certificate;
     Sas              = sas;
     ServicePrincipal = servicePrincipal;
     SqlAdmin         = sqlAdmin;
 }
Example #5
0
 public Passenger(string name, PassengerType type, string certificateNumber, CredentialsType certificateType, string mobilephone, List <string> ticketNumbers)
 {
     Name = name;
     Type = type;
     CertificateNumber = certificateNumber;
     CertificateType   = certificateType;
     Mobilephone       = mobilephone;
     TicketNumbers     = ticketNumbers;
 }
Example #6
0
        private static CredentialsType createPasswordCredentials(string clearValue)
        {
            PasswordType passwordType = new PasswordType();

            passwordType.value = createProtectedStringType(clearValue);

            CredentialsType retval = new CredentialsType();

            retval.password = passwordType;
            return(retval);
        }
        /// <summary>
        /// Retrieve credentials from the windows credential manager
        /// </summary>
        /// <param name="Name">Credential label (name)</param>
        /// <param name="authenticationType">The authentication Type</param>
        /// <returns></returns>
        public static ICredentials GetStoredCredentials(string Name, CredentialsType authenticationType)
        {
            ICredentials result = null;

            switch (authenticationType)
            {
            case CredentialsType.SharePointOnline:
                result = CredentialManager.GetSharePointOnlineCredential(Name);
                break;

            case CredentialsType.SharePointActiveDirectory:
                result = CredentialManager.GetCredential(Name);
                break;
            }
            return(result);
        }
Example #8
0
        public ActionResult CreateOrEdit(Guid id)
        {
            bool isNew = false;
            var  bo    = _Service.GetSingle(id);

            if (bo == null)
            {
                bo    = new CredentialsType();
                bo.ID = id;
                isNew = true;
            }
            var boVM   = new CredentialsTypeVM(bo);
            var editor = PageComponentRepository <CredentialsTypeVM> .CreateOrEditDialog(boVM, isNew);

            return(Json(editor));
        }
Example #9
0
        public ActionResult Save(CredentialsTypeVM boVM)
        {
            if (ModelState.IsValid)
            {
                var bo = _Service.GetSingle(boVM.ID);
                if (bo == null)
                {
                    bo    = new CredentialsType();
                    bo.ID = boVM.ID;
                }

                boVM.MapToBo(bo);
                _Service.AddOrEditAndSave(bo);

                return(Json(PageComponentRepository <CredentialsTypeVM> .SaveOK(true, "1", "")));
            }
            else
            {
                var vItems = new List <ValidatorResult>();
                foreach (var item in ModelState)
                {
                    if (item.Value.Errors != null)
                    {
                        foreach (var vItem in item.Value.Errors)
                        {
                            var errItem = new ValidatorResult();
                            errItem.Name         = item.Key;
                            errItem.ErrorMessage = vItem.ErrorMessage;
                            vItems.Add(errItem);
                        }
                    }
                }

                var editor = PageComponentRepository <CredentialsTypeVM> .UpdateCreateOrEditDialog(boVM, false, vItems).InnerHtmlContent;

                return(Json(editor));
            }
        }
Example #10
0
 internal NoneDatastoreCredentials(CredentialsType credentialsType) : base(credentialsType)
 {
     CredentialsType = credentialsType;
 }
Example #11
0
        public ExecuteResult <ReservedPnr> SsrFoid(string pnrCode, string name, string oldNumber, string newNumber, CredentialsType certificateType, string userName)
        {
            var veService = new veSWScnService();

            veService.Url = ReplaceUrl(veService.Url);
            string returnString = veService.SSRFOID(pnrCode, name, oldNumber, newNumber, certificateType.ToString(),
                                                    "KMG215", userName);

            XDocument xdoc = XDocument.Parse(returnString, LoadOptions.None);

            returnString = xdoc.Element("VESSRFOID") != null
                               ? xdoc.Element("VESSRFOID").Element("PNR").Value
                               : returnString;

            string      rawData = returnString;
            ReservedPnr result  = Domain.Utility.Parser.GetPnrContent(rawData);

            return(new ExecuteResult <ReservedPnr>
            {
                Success = (result != null),
                Result = result,
                Message = rawData
            });
        }
Example #12
0
 public DatastoreCredentials(CredentialsType type)
 {
     Type = type;
 }
        /// <summary>
        /// Create a credentials object according to the authentication type
        /// </summary>
        /// <param name="userName">UserName or AppID</param>
        /// <param name="passWord">Password or AppSecret</param>
        /// <param name="authenticationType">The authentication type</param>
        /// <returns>ICredential implementation object</returns>
        public static ICredentials CreateCredentials(string userName, string passWord, CredentialsType authenticationType)
        {
            ICredentials result = null;

            switch (authenticationType)
            {
            case CredentialsType.SharePointOnline:
                SecureString securePassword = new SecureString();
                foreach (char c in passWord.ToCharArray())
                {
                    securePassword.AppendChar(c);
                }
                result = new SharePointOnlineCredentials(userName, securePassword);
                break;

            case CredentialsType.SharePointActiveDirectory:
                result = new NetworkCredential(userName, passWord);
                break;
            }
            return(result);
        }
        /// <summary>
        /// Create a credentials object according to the authentication type
        /// </summary>
        /// <param name="userName">UserName</param>
        /// <param name="securePassword">Password</param>
        /// <param name="authenticationType">The authentication Type</param>
        /// <returns>ICredential implementation object</returns>
        public static ICredentials CreateCredentials(string userName, SecureString securePassword, CredentialsType authenticationType)
        {
            ICredentials result = null;

            switch (authenticationType)
            {
            case CredentialsType.SharePointOnline:
                result = new SharePointOnlineCredentials(userName, securePassword);
                break;

            case CredentialsType.SharePointActiveDirectory:
                result = new NetworkCredential(userName, securePassword);
                break;
            }
            return(result);
        }
Example #15
0
 internal AuthType GetLdapAuthenticationTypes(ActiveDirectoryConnectionProtection connectionProtection, CredentialsType type)
 {
     return(this.ldapAuthTypes[(int)connectionProtection, (int)type]);
 }
Example #16
0
 private Credentials(CredentialsType credentialsType, string identifier, string secret)
 {
     Identifier      = identifier;
     Secret          = secret;
     CredentialsType = credentialsType;
 }
 internal AuthType GetLdapAuthenticationTypes(ActiveDirectoryConnectionProtection connectionProtection, CredentialsType type)
 {
     return ldapAuthTypes[(int) connectionProtection, (int) type];
 }
Example #18
0
 internal System.DirectoryServices.AuthenticationTypes GetAuthenticationTypes(ActiveDirectoryConnectionProtection connectionProtection, CredentialsType type)
 {
     return(this.authTypes[(int)connectionProtection, (int)type]);
 }
Example #19
0
        private bool updateCredentials(string passengerName, string oldCrendentials, string newCrendentials, CredentialsType passengerType, Guid oemId)
        {
            var execResult = CommandService.ModifyCertificateNumber(Code, passengerName, oldCrendentials, newCrendentials, passengerType, oemId);

            return(execResult.Success);
        }
Example #20
0
 internal DatastoreCredentials(CredentialsType credentialsType)
 {
     CredentialsType = credentialsType;
 }
Example #21
0
 public void MapToBo(CredentialsType bo)
 {
     bo.Name        = this.Name;
     bo.Description = this.Description;
     bo.SortCode    = this.SortCode;
 }
Example #22
0
        /// <summary>
        /// 根据给出的旅客订座记录编号和姓名,修改旅客证件号码。
        /// </summary>
        /// <param name="pnrPair">旅客订座记录编号</param>
        /// <param name="name">旅客姓名</param>
        /// <param name="oldNumber">原证件号</param>
        /// <param name="newNumber">新证件号</param>
        /// <param name="type">证件类型</param>
        /// <param name="oemId">OEM编号</param>
        /// <returns></returns>
        public static ExecuteResult <ReservedPnr> ModifyCertificateNumber(PNRPair pnrPair, string name, string oldNumber, string newNumber, CredentialsType type, Guid oemId)
        {
            // 参数验证
            if (PNRPair.IsNullOrEmpty(pnrPair))
            {
                throw new ArgumentException("旅客订座记录编码");
            }

            var userName = "******";

            try
            {
                var repository = Factory.CreateCommandRepository();
                PidManagementService.SaveCounter(oemId, true);
                var result = repository.SsrFoid(pnrPair.PNR, name, oldNumber, newNumber, type, userName);

                if (result.Success)
                {
                    PidManagementService.SaveCounter(oemId, true);
                }

                return(result);
            }
            catch (Exception e)
            {
                return(new ExecuteResult <ReservedPnr>()
                {
                    Success = false,
                    Message = e.Message,
                    Result = null
                });
            }
        }
Example #23
0
        private static CredentialsType createPasswordCredentials(string clearValue)
        {
            PasswordType passwordType = new PasswordType();
            passwordType.value = createProtectedStringType(clearValue);

     	    CredentialsType retval = new CredentialsType();
            retval.password = passwordType;
            return retval;
        }